如果字段level的值可能为1,2,3,4,每次随机选取level值分别为1,2,3,4的记录四条,语句如下
select uid,level from (select * from tabel_name1 order by rand()) t group by level limit 4;
如果字段level的值可能为1,2,3,4,每次随机选取level值分别为1,2,3,4的记录四条,语句如下
select uid,level from (select * from tabel_name1 order by rand()) t group by level limit 4;