is is possible to order by multiple rows?
I want my users to be sorted by last_activity, but at the same time, i want the users with pictures to appear before the ones without
Something like this:
SELECT some_cols
FROM `prefix_users`
WHERE (some conditions)
ORDER BY last_activity, pic_set DESC;
This question is related to
mysql
sql-order-by
SELECT id, user_id, video_name
FROM sa_created_videos
ORDER BY LENGTH(id) ASC, LENGTH(user_id) DESC
Sort by picture and then by activity:
SELECT some_cols
FROM `prefix_users`
WHERE (some conditions)
ORDER BY pic_set, last_activity DESC;
Source: Stackoverflow.com