--查询一条随机数上来
select * from tablename where t_id=(select trunc(dbms_random.value(min(条件),max(条件))) from tablename;
select * from dept where did=(select trunc(dbms_random.value(min(rownum),max(rownum))) from dept);
--查询N条随机记录上来
select * frmo (select * from tablename order by sys_guid()) where rownum<N
select * from (select * from dept order by sys_guid()) where rownum < 5;
--查询出表中X条中从N到M条特定记录上来(分页查询)
select * from (select rownum r,t.* from tablename t where rownum<X) ss where ss.r>N and ss.r <=M
select * from (select rownum r, t.* from dept t where rownum<6) ss where ss.r > 2 and ss.r <= 10