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

Home -> Community -> Usenet -> c.d.o.server -> SQL question

SQL question

From: R Fray <russ_at_u-net.net>
Date: Wed, 16 Sep 1998 21:32:55 GMT
Message-ID: <36002dba.95308595@news.u-net.com>

Hi,

I can use select max(xyz) and min(xyz) to select the maximum and minimum occurence of a column within a table.

What I need to do however is select the first or last occurence of a column within a table, to get rid of a duplicate value.

Ie, if I use :

        insert into table1 (select value from table2 where a=b);

I can't use :

        insert into table1 (select max(value) from table2 where a=b);

Because 'value' can be the same in more than one instance, hence using max does not weed out duplicated.

Is there something equivalent to :
insert into table1 (select first(value) from table2 where a=b);

So that I can select the first instance and ignore all others?

I'm really stuck on this and would appreciate some urgent help.

Please cc replies to russ_at_u-net.net

Thanks,
Russell Fray.

--

Russell Fray
U-NET Ltd. Received on Wed Sep 16 1998 - 16:32:55 CDT

Original text of this message

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