现在有个解决方案了,看看有何 Bug。会不会在前面的出现的概率高
$count= select count(*) from table;
$limit= 10;
select id,floor(rand()*$count) as r from table where floor(rand()*$count) < $limit * 2 order by r limit $limit;
【 在 chaobill (若我离去,后会无期) 的大作中提到: 】
: 是的,就是 order by rand() 要做个临时表
: 24万的数据量,还不到百万就这么慢了
--
FROM 211.99.222.*