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

Home -> Community -> Usenet -> c.d.o.misc -> Re: A newbie question about select record with distinct colum?

Re: A newbie question about select record with distinct colum?

From: Falko Rotter <fantomas99_at_gmx.de>
Date: Fri, 17 Aug 2001 10:25:05 +0200
Message-ID: <9likbu$jml$1@newsread2.nexgo.de>

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

Original text of this message

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