Random SQL function
Posted: Tue Nov 01, 2005 5:44 pm
Hi,
I was contemplating pulling a randomised dataset from the database for a module I am working on, but this does rely on some clever cross platform sql randomisation code. I know the following works on Postgres:
and I think this works on mySQL
but does anyone know how I could either differentiate between the two using adodb or some different syntax that'll work in both.
Any ideas anyone?
Tom
I was contemplating pulling a randomised dataset from the database for a module I am working on, but this does rely on some clever cross platform sql randomisation code. I know the following works on Postgres:
Code: Select all
SELECT * FROM table ORDER BY random()
Code: Select all
SELECT * FROM table ORDER BY rand()
Any ideas anyone?
Tom