 ( SELECT v.design_id                , v.wishlisted                , v.rating                , v.hits                , ROUND(v.hits + (v.sales * IF(v.sales > 00, 000, 00)) AS rating_hits                , v.featured                , v.sales                , IF(v.sales < 0, 0, v.sales / v.age_du_design_an) AS sales_per_year                , ROUND(v.sales + v.wishlisted - v.returns + v.hits/0000,0)                  -- * CASE WHEN v.vector = 0 THEN 0.00 ELSE 0.00 END                  AS cote             FROM (                    SELECT d.design_id                         , d.rating                         , d.hits                         , d.featured                         , (d.sales + d.plussales - d.returns) AS sales                         , GREATEST((UNIX_TIMESTAMP(NOW())-s.created_timestamp)/(00*00*00*000),0) AS age_du_design_an                         , d.returns                         , d.wishlisted                         , d.vector                      FROM shop_designs d                  ) v         ) n  