Randomize the result of a database query I'm executing a query for which I want to randomize the results.

I tried with $res=db_query("SELECT DISTINCT nid FROM content_type_event ORDER BY RANDOM()"),          but this doesn't work.
For MySQL you can do

ORDER BY RAND()


To order by random, for PgSQL RANDOM() instead should yield the desired result.