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: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sat, 15 Nov 2003 23:22:26 -0800
Message-ID: <1068967371.133801@yasure>


Jonathan Gennick wrote:

> On Sun, 16 Nov 2003 00:08:21 -0500, Jonathan Gennick
> <jonathan_at_gennick.com> wrote:
>
>

>>An interesting twist on this problem would be to sort B and E first,
>>and then everything else in alphabetical order.

>
>
> Ah, I just had a thought. Try this:
>
>
> SELECT test_col
> FROM t
> ORDER BY DECODE(test_col,'B',1,'E',2,99), test_col;
>

This is very strange. I built a demo in which the above code, which if you look is the first code I put here in response to the OP didn't work. I even used the demo with my students. Now I can't duplicate the conditions: Strange. So since I can't duplicate the failure I will concede for the moment that the in-line view may not be necessary.

But I'd sure like to have that demo I did where it failed. Oh well!

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sun Nov 16 2003 - 01:22:26 CST

Original text of this message

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