DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR SQL
mysql order by on condition
SELECT * FROM my_table WHERE 1 ORDER BY CASE price WHEN 0 THEN 1 ELSE -1 END ASC, price asc, id asc
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#mysql
#order
#condition
ADD COMMENT
Topic
COMMENT
Name
5+7 =
Submit