mysql手册中存在rand()命令,能获取到随机行, 并使用limit 10 只采取其中几行。

SELECT id FROM user ORDER BY RAND() LIMIT 10;

 

相关文章: