Need help with Insert Query

N

news.verizon.net

Need help with insert query

I have two tables TableA and TableB

TableA
Name: David
Address: 123 West Side
City: New York


TableB
Name: David
Address: 123 West Side
Profession: Engineer

I need to Insert the data from TableB to TableA if the Address matches

I want to get rid of TableB so I want to merge the data from second and add
a
Profession in Table A

So after merging the Table A would be

TableA
Name: David
Address: 123 West Side
City: New York
Profession: Engineer

I would appreciate your help and Thanks in Advance

Nick
 
J

John Vinson

Need help with insert query

I have two tables TableA and TableB

TableA
Name: David
Address: 123 West Side
City: New York


TableB
Name: David
Address: 123 West Side
Profession: Engineer

I need to Insert the data from TableB to TableA if the Address matches

I think you need two things here. You'll need to open TableA in Design
view and add a Profession field, and then run an Update query by
joining TableA to TableB by Name and Address, and updating
TableA.Profession to TableB.Profession. You'll need a unique Index on
the combination of the two fields for this to be successful.

An Insert query inserts new rows in a table, which isn't what you want
in this case!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Query Joins 2
delete Using Join Statement 4
SQL query to Access database 5
Not It Query 2
Query with several tables. 5
query help needed 4
Unmatch query help 7
#deleted on linked table select query 2

Top