Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: MySQL 从 600K 行中快速 选择 10 个随机行使用 MySQL 选择随机行
我的数据库有 4 个列名称 ID 电子邮件性别,有 50 万行。
select * from table where sex='m';
我想获得 50 个随机行,其中 sex='M'; 哪种方法最快
select * from table where sex='m' ORDER BY RAND() LIMIT 50