SQLServer,Oracle随机函数和取前几条数据的区别.
sqlserver中:
取前10条数据: select top 10 * from table
取随机的10条数据:select top10 * from table order by newid()
oracle中:
取前10条数据: select * from tabel where rownum <11
取随机的10条数据: select * from table where rownum <11 order by dbms_random.val
浙公网安备 33010602011771号