随机从数据表中取N条数据(mysql)_MySQL
程序员文章站
2022-06-01 18:12:47
...
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
上一篇: MySQL保留关键字_MySQL