select * from table where id >= (rand() * (select max(id) from table)) limit 1;
MySQL - 高效返回一条随机记录
于 2022-07-22 15:00:11 首次发布
select * from table where id >= (rand() * (select max(id) from table)) limit 1;