Add Additional Index to Select Query & Fetch result using greater than Index ID

I have a table in which right now I am fetching result by adding a additional index but I want to fetch result using greater than operator to Additional index id

This query gives me this

SET @a:=0; 
SELECT @a:[email protected]+1 additional_id, output.*
FROM (SELECT sum(item_sale +  item_viewed) as totalSum ,item_id FROM items WHERE item_active='1' GROUP BY item_id order by totalSum desc ) output
additional_id item_id totalSum
1 3 17
2 1 5
3 2 2

But i want to use greater than operator and want result like this if additional_id > 1 then find only 2 result

additional_id item_id totalSum
2 1 5
3 2 2

How could i achieve this ?

Answer

SELECT * 
FROM (

-- your query
SELECT @a:[email protected]+1 additional_id, output.*
FROM (SELECT sum(item_sale +  item_viewed) as totalSum ,item_id FROM items WHERE item_active='1' GROUP BY item_id order by totalSum desc ) output
-- end of your query

CROSS JOIN (SELECT @a:=0) init_variable
) AS subquery
WHERE additional_id > 1