Thread: MySql Help
View Single Post
Old 07-22-2012, 12:49 PM  
kazymjir
Confirmed User
 
kazymjir's Avatar
 
Industry Role:
Join Date: Oct 2011
Location: Munich
Posts: 411
Quote:
Originally Posted by XYZTraffic View Post
When I refresh the query I still get the same item from each group... just that the final list of items is ordered randomly.
Ahhhh, true.

Try this:
Code:
SELECT * 
   FROM (SELECT * FROM `items` ORDER BY RAND()) x
   GROUP BY x.group
   ORDER BY RAND();
__________________
http://kazymjir.com/

Last edited by kazymjir; 07-22-2012 at 12:51 PM..
kazymjir is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote