Question:
Random number selection query in Oracle 9i?
anonymous
2007-08-02 06:55:18 UTC
Hi,
I have a daily list of id numbers generated every day of about 2500, I need to randomly select 1% of those numbers for data quality.

What is the best oracle sql query to select those random numbers?
Four answers:
Big D
2007-08-02 07:21:24 UTC
do an ORDER BY RAND() LIMIT 0, 250 at the end
anonymous
2007-08-02 14:08:09 UTC
This sounds like a good query. There is a Rand(N) function within SQL so sounds like you need to write a script that loops through N times for the 1% of 2500 to generate your numbers and then throughout each iteration save the random number to a table so you can access this table and build a simply query to pull the quality items.
anonymous
2007-08-02 14:04:59 UTC
You have to select all and choose radomly

else select some random index and query it

Else contact an Oracle expert at websites like http://getafreelnacer.com/
aerokan a
2007-08-06 07:17:22 UTC
Computer Tutorials, Interview Question And Answer

http://freshbloger.com/



Oracle tutorials- http://oracletutorials.info/


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...