Quote:
|
Originally Posted by jwedeking
Is there a way to write SQL select statement to select a row randomly?
|
Yes; essentially you base the row to be selected on a "random event" like the "current timestamp".
There has been a thread on this forum before with exactly this question.
E.g., with PostgreSQL, you can write
Code:
SELECT col
FROM tab
ORDER BY random()
LIMIT 1;
but this is clearly SQL "dialect"; there are standard SQL ways to do this (using e.g. the current timestamp).