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 -> Re: Update in a self join

Re: Update in a self join

From: Mladen Gogala <mgogala.SPAM_ME.NOT_at_verizon.net>
Date: Fri, 09 Feb 2007 14:09:17 GMT
Message-ID: <hg%yh.4488$da1.3236@trndny03>


On Fri, 09 Feb 2007 00:54:30 -0800, joker197cinque wrote:

> I have a table and I would like to update some columns of a dataset of
> these table with values of another dataset of the same table.
>
> I'm trying this way:
>
> update tab_join_1 p
> set p.nome =
> (select n.nome from tab_join_1 n where n.key = p.key)
> where exists
> (select 'x'
> from tab_join_1 n
> where p.key = n.key);
>
> I obtain an error of more rows returned in subquery.
>
> Any help much appreciated.
>
> Regards.

You may consider posting the exact error message which would probably be as helpful as posting something about the data structure. Other then that, I would avoid those nasty ANSI joins. There is no such thing a "portable SQL", so there is no point in using ANSI joins, except for outer joins. Of course, excessive use of outer joins signifies problems with design, but that's another story.

-- 
http://www.mladen-gogala.com
Received on Fri Feb 09 2007 - 08:09:17 CST

Original text of this message

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