oracle 随机函数的特殊用法 随机得到一条数据:
select *
from (select * from test_wsg_20110207 where ob_status =1 order by dbms_random.value)
where rownum=1;
本文介绍了一种使用Oracle数据库中的随机函数来随机选取一条记录的方法。通过结合使用dbms_random.value函数与order by子句,再配合rownum限制返回结果数量为1,可以有效地实现从指定表中随机获取一条数据。
oracle 随机函数的特殊用法 随机得到一条数据:
select *
from (select * from test_wsg_20110207 where ob_status =1 order by dbms_random.value)
where rownum=1;

被折叠的 条评论
为什么被折叠?