TL;DR: You can use ORDER BY column1 DESC, column2 ASC ... in your code.
The other day I was trying to get a custom ordering in a list for an object:
* order decreasing by UNREAD MESSAGES count and then
* order ascending by DATE
Initially, I tried a GROUP BY, but