Answer the question
In order to leave comments, you need to log in
Difference between ORDER by 1 and ORDER by IF(somefield='foobar', 1,0)?
What's the Difference
SELECT name, name2 FROM table
ORDER by 1
SELECT name, name2 FROM table
ORDER by IF(name='denis', 1,0)
Answer the question
In order to leave comments, you need to log in
select fieldname /*, ... */ from tablename order by 1
select IF(name='denis', 1,0) as sortfield, /*fields*/ from tablename order by sortfield
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question