Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORDER BY clause without sorting needed...
I believe that in 7.3.4 (patch 3) there is a fix for not sorting (if an order
by is specified) and the the result can be derived from an index. (I may have
my wording a bit wrong here).
Anjo.
"Igor V. Podolsky" wrote:
> Hi all !
>
> I got a following troubles: I wish that my query result set will be not
> sorted, but I with still have ORDER BY clause in it. Now I'm using 'ORDER
> BY -1' and following query example works fine:
>
> SELECT id, name FROM customer ORDER BY -1
>
> This query returns result set without sorting. (By the way:
>
> SELECT id, name FROM customer ORDER BY 1
>
> returns sorted by 'id' result set). But I got error 'ORA-01785:
> ORDER BY item must be the number of a SELECT-list expression' when I try
> 'ORDER BY -1' with UNION queries. Following statement causes error:
>
> SELECT id, name FROM customer
> UNION
> SELECT 0, ' ' FROM dual
> ORDER BY -1
>
> Is there any another way to prevent query with ORDER BY clause from
> sorting ? Why 'ORDER BY -1' works by different way with the UNION query ?
>
> P.S. Duplicate answers (if any :( ) to my e-mail please...
>
> --
> Is There A God Or Any Kind Of Justice Under The Sky... (Queen'91)
>
> Igor V. Podolsky (igoryok_at_soft-review.kiev.ua)
Received on Tue Nov 24 1998 - 23:22:02 CST