Sql获取表中随机1到n条数据

select * from(
select a.*,rownum rn from(
select t.*
from TABLENAME t
where 1=1
order by dbms_random.value
) a ) b
where b.rn=1

猜你喜欢

转载自www.cnblogs.com/IceBlueBrother/p/9187433.html