1,mysql随机查询
select * from 表名 order by rand() limit 随机查询的数量;
2,sql server随机查询
select top 随机查询的数量 * from 表名 order by newid();
3,oracle随机查询
select * from
(select * from 表名 order by dbms_random.value)
where rownum<=20;
原文链接:https://blog.csdn.net/nidayu/article/details/44598285