Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: order by
At 10:44 AM 1/1/2004, you wrote:
>I was curious to find out why all the other sorts work the same but order by
>dbms_random.value ( which also returns a number like sqrt (3.14) ) behaves
>totally different. Any ideas ?
When you order by dbms_random, Oracle will generate a random number for each row and sort on those random numbers. When you order by a constant real value, Oracle has no way to order the results, so they will be returned in whatever order they are retrieved from the database.
>Also could you please tell me what does it mean when someone says order by
><non integer some_constant> . An integer constant would refer to the
>positional parameter but what about a real value which is not an integer ?
Aside from SQL brain-teasers, I cannot imagine a practical use for ORDER BY <<constant real number>>.
Justin Cave
Distributed Database Consulting
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Justin Cave INET: jcave_at_cableone.net Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Thu Jan 01 2004 - 13:09:25 CST
![]() |
![]() |