mysql - SQL syntax for ORDER BY random sublevel? -


i need dumbest of questions. want make query ordered 1 field, named 'client_level'. table has 400 rows, , client_level possible values null, 1,2,3,4 , 5.

those client levels. want order clients client_level. clients leveled 5 should go before clients level 4 , on.. easy.

select * client order client_level desc; 

the problem is.... want randomize each sub-group of clients make order inside client level different each time, , therefore, equilibrated on time , query not work think should.

select * client order client_level, rand() desc; 

i sure there must way, thank answers. kind regards,

i think misplaced desc. try:

select * client order client_level desc, rand(); 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -