Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Update in a self join
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.comReceived on Fri Feb 09 2007 - 08:09:17 CST
![]() |
![]() |