Here is the screnario, i have2 tables table1 and table2 and i need to update the table1 using table2 as there are quite a few duplicate in table2 but need to pick one using the where clause in table2
Table1(unique table)
Email_Address|Country|Region|Source|PP|PS
a@a.com IN AP SS ES PP
b@g.com US AM ES ST PO
Table2(duplicate values)
Email_Address|Country|Region|Source|PP|PS
a@a.com IN AP SS ES PP
a@a.com ES AP SS ES SST
a@a.com IN AP MS ES P
a@a.com IN AP NS ST PP
b@g.com US AM ES ST PO
b@g.com IN AP NS ST PP
Now i need to get the distinct values from Table2 where the source is SS and need to be mapped against the Table1 email.
I'm using something like this but is not working,
Update Table1
Set Table1.Country=Table2.Country,Table1.PP=Table2.PP
Where Email_Address In (Select Distinct Email_Address
From Table2
where Table2.Source = 'SS')
any help would be a helpful