What's your end goal, and for what do you need/desire a "weighted random?"  Your
objective will determine if this is actually of use or if it simply appears to
be.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


----- Original Message -----
From: "Dathan Vance Pattishall" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, 10 June, 2003 14:19
Subject: Hmm looks like this query works


I have a question. If I wanted to sort randomly on a column weighted by
the value of the column will does this query work

SELECT val_column, val_column*0.1+RAND() as rand_col from TABLE ORDER BY
rand_col limit 10;

This should five me a random row weighted by the value of the column is
this correct? Seems to be but I might be wrong.

Thanks for any tips

--
Dathan



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to