Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: nvl question
Try this
select distinct tab1.col1
from tab1
order by tab1.col1 desc
-- ------------------------------------ Make Unlimited phone calls from your PC to ANY phone in the World! http://www.eboom.com/free/ <kazelot_at_thenut.eti.pg.gda.pl> wrote in message news:Pine.LNX.4.33.0106300936100.2098-100000_at_thenut.eti.pg.gda.pl...Received on Sat Jun 30 2001 - 07:24:42 CDT
> I want to select values from one column of my table. The values can be
> repeated in the column, and I want them distinct. I want them oredered
> alphabetically.
>
> select distinct tab1.col1
> from tab1
> order by tab1.col
>
>
> My select returns null as the last value and I would like it to be first?
> How should I do this?
>
> I thought about using nvl function here, but I don't know how (it didn't
> allow me to use 'distinct').
>
> For now I came up with the following:
>
> select distinct tab1.col
> where tab1.col is null
>
> union all
>
> select distinct tab1.col
> where tab1.col is not null
>
>
> Any better ideas? Thank in advance,
> kazelot
>
![]() |
![]() |