I have two tables. I want to migrate the data from Table B into Table A (below). There are no explicit links or key between the two tables, but TextID in Table A corresponds to ID in Table B.
Table A
ID (auto) e.g. 2002
Title e.g. My Article Title
TextID e.g. 38
Table B
ID (auto) e.g. 38
Keywords e.g. Blah, blah, blah
Body e.g. Article text
Can this be accomplished via SQL? Is it possible to insert selected data along the lines below? If so, can someday advise me on the proper syntax? Any help would be appreciated.
(This assumes that I've created the corresponding columns in Table A)
INSERT INTO TableA (Keywords, Body) VALUES (??????) WHERE TableA.TextID = TableB.ID
Migrating Data from One Table to Another Using SQL
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Look at the syntax for INSERT ... SELECT