Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: A newbie question about select record with distinct colum?
Hi,
> I need a help to learn how to select a distinct row from a table which
> some of the columns are duplicated. For example:
> Table I has
> c1 c2 c3 c4
> row1 A x y z
> row2 A g e f
> row3 B l m n
>
> and I only want to get row1 ( or row2) and row3. Greatly appreciate
> your tip.
i think that only column c1 is the field which should not be duplicated. Please correct me if i have understood wrong.
try this:
select *
from table1
where rowid in (select min(rowid) as r from table1 group by c1);
Regards,
Falko Rotter
Rotter & Kalweit Softwaredesign GbR
Friemarer Straße 38
99867 Gotha
GERMANY
Received on Fri Aug 17 2001 - 03:25:05 CDT
![]() |
![]() |