Jean-Francois.Doyon@CCRS.NRCan.gc.ca wrote:
> Hello,
>
> I'm trying to retrieve a limited number of random rows, and order them by a
> column, and am not having any luck with that last part:
>
> SELECT * FROM tablename ORDER BY random(), id LIMIT 10
How about:
SELECT * FROM
(SELECT * FROM tablename ORDER BY random() LIMIT 10) AS data
ORDER BY id;
HTH,
Mike Mascari
mascarm@mascari.com