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?
If you need a pseudo-random order, you can do something like this (PHP):
Plus, you can set $seed to the predefined value and always get same results.
I’ve learned this trick from my colleague http://steamcooker.blogspot.com/