+2 votes
by
There is a sign saying:
1ade787b12cf41e49db9fe6853a91593.png


Tell me how to make a request that would be sort by price ascending, but the elements from which qt = 0 to deduce the last one?

That is, in the end I want to get this result:65d5596a307746f896ccd73aa7e03930.png

1 Answer

0 votes
by
 
Best answer
try
SELECT * FROM TBL_MYTABLE WHERE qt > '0' ORDER BY price
UNION SELECT * FROM TBL_MYTABLE WHERE qt = '0' ORDER BY price
...