ORACLE/MSSQL随机取一条记录方法
oracle随机取数据:
select * from ( select * from sys_dict order by sys_guid() )where rownum =1
?
oracle随机取数据2:
select * from ( select * from sys_dict order by dbms_random.value )where rownum <2
?
sqlserver 随机取数据:
select top 1 * from 表名 order by newid ()
?重点在于newid()生产随机值,
取多条则将top后面数字改成具体数量即可
?