Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updateing one table with data from another

Status
Not open for further replies.

imstillatwork

IS-IT--Management
Sep 26, 2001
1,605
US
How do I update table "A" with data from table "B" with one query?
 
To insert data from one to another:
Code:
INSERT INTO tableA (columnA,columnB,columnC) SELECT columnX,columnY,columnZ FROM tableB WHERE ...

To update:
Code:
UPDATE tableA
SET    columnA=(SELECT columnX FROM tableB WHERE ...)
WHERE  ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top