Does SQLite support seeding the RANDOM()
function the same way MySQL does with RAND()
?
$query = "SELECT * FROM table ORDER BY RAND(" . date('Ymd') . ") LIMIT 1;";
From the MySQL Manual about RAND(N)
:
If a constant integer argument N is
specified, it is used as the seed
value, which produces a repeatable
sequence of column values. In the
following example, note that the
sequences of values produced by
RAND(3) is the same both places where
it occurs.
If not, is there any way to archive the same effect using only one query?
Copyright Notice:Content Author:「Alix Axel」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/2171578/seeding-sqlite-random