Q: mysql query order by id desc plus if a value is less then on top my query fetches results by id descending but what i wish is say by default new entry results show by id desc on top whenever page is refreshed but if any value in already added data in quantity column is less than 2 then it should displays on top then followed by new entries order by id desc
SELECT * FROM product ORDER BY id DESC, quantity <2 DESC

I tried that but does not seem to be working.

A: You could check  the condition in order by  prior of the id
       SELECT * 
       FROM product 
       ORDER BY case when quantity <2 then 0 else 1 end desc,
       id DESC


A: You can try below query:
select * ,(case when quantity<2 then 1 else 2 end)priority, row_number()over (order by id desc) rown from product
order by priority,rown

or if you want to avoid priority and rownumber in your result you can use cte as below:
with cte as (select * ,(case when quantity<2 then 1 else 2 end)priority, row_number()over (order by id desc) rown from product
    )
select col1,col2.... from cte order by priority,rown

