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

posted @ 2018-06-15 15:15  Ice_Blue_Brother  阅读(374)  评论(0编辑  收藏  举报