View Full Version : UPDATE From one table to another using WHERE


Nigel Cross
10-14-2009, 10:27 AM
Can anyone advise me on what the SQL syntax would be to update a record within one table with the data selected from another table… e.g.


UPDATE TABLE1 (COL1)
With the data from TABLE2 (COLa,)
WHERE TABLE1 COL2 = TABLE2 (COLc,) or TABLE2 (COLb,) or TABLE2 (COLc,)


Thank you Nigel Cross

HiTechCoach
10-14-2009, 01:45 PM
Something like:


UPDATE TABLE1 (COL1)
Select TABLE2.COLa from TABLE2
WHERE TABLE1.COL2 = TABLE2 .COLc.
or TABLE1.COL2 = TABLE2.COLb
or TABLE1.COL2 = TABLE2. COLc


I would also suggest checking the help file for more examples.

Nigel Cross
10-15-2009, 02:16 PM
Thanks HiTec I give it a try.

Thank for your in put.

Nigel Cross
10-27-2009, 05:22 AM
Thanks Hitec, this worked just great.:)