I have two tables --
mhrsDemo, and demo --
They have records in them that sometimes equal each other (talking PK). When they do equal each other, I want to take some values from mhrsDemo and UPDATE them to the demo table
I'm trying to consolidate two demographic tables into one --
Here is my erroneous statement:
UPDATE demo
SET demo.region2 = mhrsDemo.region, demo.mhrs = mhrsDemo.mhrs
FROM
(SELECT mhrsDemo.[id], mhrsDemo.region, mhrsDemo.mhrs FROM selectDemo INNER JOIN
mhrsDemo ON selectDemo.id = mhrsDemo.ID)
See, so all I really want is two fields from the mhrsDemo table to be updated to existing records in the demo table where the PK (id in both) are equal to each other. I have THOROUGHLY confused myself here, and would appreciate some help.
If you need more info, just ask -- I'm not quite sure what all you will need --
Thanks everyone
Paul Prewett
mhrsDemo, and demo --
They have records in them that sometimes equal each other (talking PK). When they do equal each other, I want to take some values from mhrsDemo and UPDATE them to the demo table
I'm trying to consolidate two demographic tables into one --
Here is my erroneous statement:
UPDATE demo
SET demo.region2 = mhrsDemo.region, demo.mhrs = mhrsDemo.mhrs
FROM
(SELECT mhrsDemo.[id], mhrsDemo.region, mhrsDemo.mhrs FROM selectDemo INNER JOIN
mhrsDemo ON selectDemo.id = mhrsDemo.ID)
See, so all I really want is two fields from the mhrsDemo table to be updated to existing records in the demo table where the PK (id in both) are equal to each other. I have THOROUGHLY confused myself here, and would appreciate some help.
If you need more info, just ask -- I'm not quite sure what all you will need --
Thanks everyone
Paul Prewett