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: What is wrong with my SQL ?

Re: What is wrong with my SQL ?

From: Lars Kristiansen <lars.kristiansen_at_bergen.online.nospam>
Date: Fri, 26 Mar 1999 12:38:24 GMT
Message-ID: <36fb7edf.19450350@news.online.no>


On Fri, 26 Mar 1999 13:10:42 +0100, "Jørgen Haukland" <jorgen.hauikland_at_fou.telenor.no> wrote:

>Hello !
>
>I'm trying to update a column in my main table with values from a similar
>column in another table when the primary keys column match. This is my SQL:
>
> UPDATE TableA
> SET TableA.Col1 = TableB.Col1
> WHERE TableA.PrimaryKeyCol = TableB.PrimaryKeyCol
>
>I get an "invalid column name" error whenn I try this.
>
>What is wrong ?
>
>Joergen Haukland
>NORWAY
>

You should try something like this :
UPDATE TabelA SET TabelA.Col1 = (SELECT TableB.Col FROM TableB WHERE TableB.PrimaryKeyCol = TabelA.PrimaryKeyCol)

Lars Kristiansen
email: lars.kristiansen_at_bergen.online.nospam ~ Remove spam to reply ~ Received on Fri Mar 26 1999 - 06:38:24 CST

Original text of this message

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