假设随机取一天内的五条数据吧
for(i=1;i<=5;i++)
{
$num = mt_random(1,1000);
sql = "select * from table where id = { $num} and sj =时间 ";
}
循环五次。每次取一条、然后自己在存入数组就可以了
select * from a where a between '2012-08-25 08:00:00' and '2012-08-25 09:00:00' order by random limit N;