Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of randomly fetching data by oracle

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the knowledge of "the method of randomly fetching data from oracle". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

No matter on the Internet or in reality, I have a taste of loneliness, which is a kind of ORACLE random query 1.select * from (select * from tablename order by dbms_random.value) where rownum < N; Note: dbms_random is a package that can generate random values or strings. Value () is the most commonly used, and there are generally two uses of value (). The first function value return number; has no parameters and returns a value with a precision of 38 bits, ranging from 0.0 to 1.0, but not including 1.0. The following example: dbms_output.put_line (round (dbms_random.value*100)); the second value takes two parameters, the first refers to the lower limit and the second refers to the upper limit, which will generate a number from the lower limit to the upper limit, but does not include the upper limit, as follows: dbms_output.put_line (trunc (dbms_random.value (1101)); 2.select * from tablename sample (3) where rownum < 4

Select empno,empname from (select empno,empname from emp order by dbms_random.value ()) where rownum

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report