I'm having problems trying to order the results from a MySQL query.
The table contains user information, notably:
- user_status (an integer)
- user_verified (boolean)
- last_login (date)
The ORDER BY clause should group users into 6 main groups and within each group order them by the last_login DESC.
Thus I'm trying to get (in pseudo code):
first show users: user_status = 1 AND user_verified = true, last_login DESC
then: user_status = 1 AND user_verified = false, last_login DESC
then: user_status = 2 AND user_verified = true, last_login DESC
then: user_status = 2 AND user_verified = false, last_login DESC
then: user_status = 0 AND user_verified = true, last_login DESC
then: user_status = 0 AND user_verified = false, last_login DESC
I'm having problems putting this together into a coherent ORDER BY clause so any help would be appreciated!