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: SQL Update question

Re: SQL Update question

From: KeyStroke (Jack L. Swayze Sr.) <KeyStrk_at_Feist.Com>
Date: Thu, 10 Dec 1998 21:38:18 -0600
Message-ID: <367093AA.B1798D3C@Feist.Com>


Yes, it looks as if your statement is syntactically correct (with the exception of a missing right par end at the end and the semicolon). However, it is more complicated than it needs to be:

update tablea set value1 = 'XXX'
  where key in
(select tableakey from tableb

   where value2 = 'ZZZ')
;

Rich D wrote:

> I am trying to update a column in a table, and I am using a subquery since
> the criteria involves a join.
>
> TableA
> key
> name
> value1
>
> TableB
> key
> tableakey
> value2
>
> Here is my SQL statement:
>
> update tablea set value1 = 'XXX' where tablea.key in
> (select tableb.tableakey from tablea, tableb where
> tablea.key = tableb.tableakey and
> value2 = 'ZZZ'
>
> My update of tableA depends on a value in a column in tableB. There will be
> multiple records in tableB that meet the criteria.
>
> Am I on the right track? It's not working (SQL error - ORA-00936 missing
> expression).
>
> Thanks for any help,
>
> Rich Dolan
Received on Thu Dec 10 1998 - 21:38:18 CST

Original text of this message

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