SQLite - ORDER BY RAND()

Alix Axel picture Alix Axel · Aug 10, 2009 · Viewed 50.2k times · Source

In MySQL I can use the RAND() function, is there any alternative in SQLite 3?

Answer

avnic picture avnic · Aug 10, 2009
SELECT * FROM table ORDER BY RANDOM() LIMIT 1;