In my MySQL 5.5 database, I have a table of commerces which I need to sort first with the column logo (rows with logo entries not null first) and at the same time sort those rows alphabetically with the column title.
The result I need is this:
| Logo | Title |
| --- | ------ |
| img | ATitle |
| img | BTitle |
| img | CTitle |
| ... | ... |
| NULL | ATitle |
| NULL | BTitle |
| ... | ... |
I tried this query already:
SELECT * FROM commerces ORDER BY logo DESC, title ASC
But this query seems to sort the whole list without distinction to logo not null or null.
So my question is if there is a solution in an unique query to sort my rows as wanted?
Thank you in advance