果想随机抽取其中4条记录
create table t as select * from all_objects where rownum <= 5000;
set timing on
select object_name, object_id
from ( select object_name, object_id
from t
where object_name like '%%'
order by dbms_random.random )
where rownum <= 4;
select object_name, object_id
from ( select object_name, object_id
from t sample ( 1 )
where object_name like '%%'
order by dbms_random.random )
where rownum <= 4;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/644902/viewspace-159243/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/644902/viewspace-159243/