MySQL: How to sort by 1) a='true' and 2) a<> 'true' ? (Jet SQL) (Urgent)
Posted on 2003-11-06
I don't know if this is a Microsoft-Access specific question or if you can solve it with normal MySQL too?
I need to make an "ORDER BY" cause which sorty a text field. The text field may contain nothing at all (null?), the text "true" or the text "false" (yes, instead of a boolean, this can not be changed).
I need a result where all entries with "fieldName='true'" are listed on top and then everything else sorted by the date in "fieldDate".
ORDER BY (fieldName ='true'), (fieldName <> 'true'), fieldDate