Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
So I can't get this SQL statement to run

So Table A is connected to table C through the ID and that ID is connected to Table C through ID
I need to get a UPC column Data from table C where table A ID = table C ID

SQL
UPDATE A
SET A.ID = [C].[UPC];
INNER JOIN TABLEB ON  A.ID = B.ID
INNER JOIN C ON B.ID = C.ID
Posted
Comments
Bala Selvanayagam 29-Sep-11 12:12pm    
My understanding is,

Table A - has a column called ID
Table C - has columns ID,UPC

Both tables are connected through ID column...now what exactly you want to do please ? you question is not clear to me
roman_s 29-Sep-11 12:14pm    
Oh forgot to mention

Table A also has a UPC Column im trying to update all UPC of table A from UPC from table C

If you are using SQL Server then (T-SQL)
UPDATE A
SET ID = [C].[UPC]
FROM A 
INNER JOIN B ON  A.ID = B.ID
INNER JOIN C ON B.ID = C.ID

else I can not help you as I use T-SQL not SQL.
 
Share this answer
 
SQL
UPDATE A
SET A.UPC = [C].[UPC]
From A
INNER JOIN B ON  A.ID = B.ID
INNER JOIN C ON B.ID = C.ID
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900