1
2
3
4
5 SELECT t.*
6FROM table_name AS t
7INNER JOIN
8 (SELECT ROUND(
9 RAND() *
10 (SELECT MAX(id) FROM table_NAME )) AS id
11 ) AS x
12WHERE
13 t.id >= x.id
14LIMIT 1;Code language: SQL (Structured Query Language) (sql)