Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Need help with retriving RANDOM rows from a table.

Re: Need help with retriving RANDOM rows from a table.

From: LT Cheah <LT_Cheah_at_army.net>
Date: Wed, 13 Aug 2003 21:35:36 +0800
Message-ID: <m1bjjv0disotb35i2asaedpahevejhr0vd@4ax.com>


On 12 Aug 2003 14:04:46 GMT, Rene Nyffenegger wrote:

Thanks for the tip ... never knew such a clause existed. It worked like a charm ....

=> > I would like to retrieve only a certain number of rows from a table (of
=> > production data) for statistical analysis of certain production test
=> > parameters.
=> >
=> > The table has say 1 million rows and has a Date_Time column with a date
=> > format. How does one relive say the first 20 rows of data for every hour
=> > for example.
=> >
=> > Or is there any other simpler method (by using the ROW_ID for example) such
=> > that a limited random number of rows may be retrived.
=>
=>
=> select ... from table_name SAMPLE(0.2)
=>
=> Above stmt select _approximately_ 0.2 percent of the rows of table_name.
=>
=> Hth
=> Rene
Received on Wed Aug 13 2003 - 08:35:36 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US