随机从数据表中取N条数据(mysql)_MySQL
程序员文章站
2022-05-25 19:11:27
...
bitsCN.com
随机从数据表中取N条数据(mysql) SELECT * FROM faq WHERE id >= ((SELECT MAX(id) FROM faq)- (SELECT MIN(id) FROM faq)) * RAND() + (SELECT MIN(id) FROM faq) LIMIT 9 bitsCN.com
随机从数据表中取N条数据(mysql) SELECT * FROM faq WHERE id >= ((SELECT MAX(id) FROM faq)- (SELECT MIN(id) FROM faq)) * RAND() + (SELECT MIN(id) FROM faq) LIMIT 9 bitsCN.com