1: SELECT count(*) FROM table;
2: ORDER BY RAND() LIMIT 1