Say I am querying a MySQL database of profiles under a certain city but I want those results randomized and then from that randomized order, sort by user level (admin, general, etc). I have looked at multiple solutions online with ORDER BY and GROUP BY but whenever an ORDER BY RAND() query happens followed by GROUP BY user_level, it doesn't keep the admins at the top.
So in a nutshell I am looking to randomize all profiles from table but put the admins in the result first but randomize the admins at the top in addition to randomizing the general users at the bottom. Is this possible? I am using PHP by the way.







Bookmarks