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 -> nvl question

nvl question

From: <kazelot_at_thenut.eti.pg.gda.pl>
Date: Sat, 30 Jun 2001 09:50:07 +0200
Message-ID: <Pine.LNX.4.33.0106300936100.2098-100000@thenut.eti.pg.gda.pl>

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 Received on Sat Jun 30 2001 - 02:50:07 CDT

Original text of this message

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