Answer the question
In order to leave comments, you need to log in
How to make a sql query so that goods that are not in stock always show at the end?
There is a table where if stock > 0 then available
. As in a query with Order for other columns (for example, id), make records with stock=0 always show at the end, no matter what Order I have.
For example:
ORDER by id asc, stock desc -
a trivial action does not fit, but I'm dumbing down something... please tell me
SELECT * FROM `products` ORDER by id asc
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question