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: Complex ORDER BY clauses

Re: Complex ORDER BY clauses

From: Matthias Wirtz <Matthias.Wirtz_at_epost.de>
Date: Fri, 14 Nov 2003 22:55:57 -0500
Message-ID: <bp5nut$1kan4t$1@ID-151394.news.uni-berlin.de>


"Daniel Morgan" <damorgan_at_x.washington.edu> schrieb im Newsbeitrag news:1068849441.169822_at_yasure...
> mcstock wrote:

> > | SELECT test_col
> > | FROM (
> > | SELECT test_col
> > | FROM t
> > | ORDER BY test_col)
> > | ORDER BY DECODE(test_col, 'B', 1, 'E', 2, 99);

> > why the double order by?

> The original wanted everything ordered with B and E pulled out. The
> entire set must be ordered first. The outer query only changes the
> value of the two selected values.

I understand what you are trying with this inner query, but this is not working for me.

I get the same result when I skip the inner query. B and E are fine but the rest is not sorted alphabetically.

Explain plan states clearly the two different plans: with the above query I get two sort operations. If I skip the inner query I get only one sort operation. But the results are looking the same. Doesn't make sense to me.

--
Matthias Wirtz  -  Norfolk, USA
Received on Fri Nov 14 2003 - 21:55:57 CST

Original text of this message

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