List:General Discussion« Previous MessageNext Message »
From:mos Date:November 29 2008 7:05pm
Subject:Re: Randomize by Score and DESC
View as plain text  
At 09:15 AM 11/29/2008, sangprabv wrote:
>Hi,
>I have a query like this "SELECT * FROM table ORDER BY score DESC,
>RAND()" The aim is to randomize the result by score with descending
>order. But it doesn't work. What missed here? TIA.
>
>
>Willy


Willy,
       That is because you are ordering by Score then Rand. If Score is an 
integer, try

>SELECT * FROM table ORDER BY score+RAND() DESC


This will randomize the higher scores first, followed by the lower scores etc..



Mike  

Thread
Randomize by Score and DESCsangprabv29 Nov
  • Re: Randomize by Score and DESCmos29 Nov
    • Re: Randomize by Score and DESCsangprabv30 Nov
      • Re: Randomize by Score and DESCBrent Baisley6 Dec
        • RE: Randomize by Score and DESCJerry Schwartz8 Dec