![]() |
|||
|
|
|||
|
||||||||||||||||||||||||||||||
|
|
|
Looking for the original pages? (formerly called "Morgan's Library") You can find them here.
Term: ORDER BY
Definition: Random Ordering To order rows randomly, you must use DBMS_RANDOM, as shown here: SELECT column FROM In the example above, 5 randomly selected rows will be returned. You can also get a random sample, by using the SAMPLE clause with a SELECT statement: SELECT * FROM users SAMPLE(15); In the example above, Oracle is instructed to randomly return 15% of the rows in the 'users' table. Note that the SAMPLE clause only works for single table queries on local tables. Related Links: Related Code Snippets:
|
| Home : Code Library : Sponsors : Privacy : Terms of Use : Contact Us | 206 users online © 2009 psoug.org |