![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Assuming the <lastchanged> column belongs to table <main>, and there are no duplicate values for <lastchanged> per <ssn>, then the following update should do it: UPDATE group1 SET address1 = c.address1, address2 = c.address2, city = c.city, state = c.state, zipcode = c.zipcode, country = c.country FROM group1 AS g JOIN main AS c ON g.ssn = c.ssn WHERE c.lastchanged = (SELECT MAX(c1.lastchanged) FROM main AS c1 WHERE c1.ssn = c.ssn) HTH, Plamen Ratchevhttp://www.SQLStudio.com |
![]() |
| Thread Tools | |
| Display Modes | |
| |