Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: how to select NULL first

Re: how to select NULL first

From: TurkBear <noone_at_nowhere.com>
Date: Tue, 08 May 2001 12:21:15 -0500
Message-ID: <9oagftkpdg33672qh12aih6eemjq3n6r22@4ax.com>

Try

Select * from A order by decode(nvl(c1,0),0,'A - is null',c1)

I have no idea of the performance hit this would involve...

hth,

"Edward Rusu" <erusu_at_softcomputer.com> wrote:

>Hi All,
>
>Let's assume that we have a table A, columns c1, c2,.. with index c1. If you
>run a select:
>
>select * from A order by c1;
>
>rows with NULL value of c1 will be listed at the end. Is it possible to
>configure Oracle to have NULLs listed first?
>
>We already tried:
>
>select * from A order by 'A'||c1;
>
>but it is not good. It does sort in the right order but sometimes it makes
>Oracle crazy. It incorectly choses executuion path and query takes
>forever.... :-(
>
>Any advise?
>
>
>
>Thanks,
>
>Ed
>
>
Received on Tue May 08 2001 - 12:21:15 CDT

Original text of this message

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