Joseph Shraibman wrote:
> Is there a way to get random rows besides ORDER BY random()? The problem with ORDER BY
> random() is that is has to get all the rows from the table before the results are returned.
Yes, I think one person's idea was to assign a unique value to every
row, then do:
WHERE col > random()
ORDER BY col
LIMIT 1
or something like that.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073