SQL to Select a random row from a database table
This is a simple way to select a random record or row from a database table is MSSQL and MySQL
MSSQL:
1 2 |
SELECT TOP 1 column FROM table ORDER BY NEWID() |
MySQL:
1 2 3 |
SELECT column FROM table ORDER BY RAND() LIMIT 1 |
[source]