select * from biz_question ORDER BY RAND(id) LIMIT 1;
SELECT * FROM biz_question AS t1 JOIN (SELECT ROUND(RAND() * ((SELECT MAX(id) FROM biz_question)-(SELECT MIN(id) FROM biz_question))+(SELECT MIN(id) FROM biz_question)) AS id) AS t2 WHERE t1.id >= t2.id ORDER BY t1.id LIMIT 1
建议第二种,效率高一些
原创文章,作者:506227337,如若转载,请注明出处:https://blog.ytso.com/277161.html