WishMeLz

生活其实很有趣

Mysql 随机数据

SELECT t1.* FROM table_name AS t1 JOIN (SELECT ROUND(RAND()*(SELECT MAX(id) 
FROM table_name)) AS id) AS t2 WHERE t1.id>=t2.id  ORDER BY t1.id LIMIT 1;