各种数据库随机读取n条数的方法 - 高飞网
99 人阅读

各种数据库随机读取n条数的方法

2016-12-23 13:15:57


数据库sql
MySqlselect * from tablename order by rand() limit 10
SQLServerselect top 10 * from tablename order by NEWID()
accessSELECT top 10 * FROM tablename ORDER BY Rnd(FId)  
Oracle
select * from (select * from tb_phone_no order by sys_guid()) where rownum < 10;


还没有评论!
54.146.5.196