Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> nvl question
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