SELECT * FROM table ORDER BY RAND() LIMIT 10000
SELECT COUNT(*) FROM table; -- Use this to determine rand_low and rand_high
SELECT *
FROM table
WHERE frozen_rand BETWEEN %(rand_low)s AND %(rand_high)s
ORDER BY RAND() LIMIT 1000
SELECT * FROM Sales.SalesOrderDetail
WHERE 0.01 >= RAND()
SELECT * FROM Sales.SalesOrderDetail
WHERE 0.01 >= CAST(CHECKSUM(NEWID(), SalesOrderID) & 0x7fffffff AS float) / CAST (0x7fffffff AS int)
select *
from table_name
where _id in (4, 1, 2, 5, 3)
SELECT TOP 5 Id, Name FROM customerNames
ORDER BY NEWID()
select id, name
from customer
order by random()
limit 5;