Table 1
Mail Special Quote (Y/N)
g@hotmail.com Blank
s@ho.com Blank
sss@j.com Blank
Table 2
Email Address Dept
g@hotmail.com Config
s@ho.com Finance
sss@j.com Marketing
Now I want Table 1 updated to Y where the matching email address in Table 2 is coming from Finance or Marketing .
UPDATE TABLE 1
Set Special Quote to be Y
where in TABLE 2 the Dept is Finance or Marketing for the matching email address.
Probably just having a brain freeze and need some coffee .
Thinking left join on email address then throw in a bit of a case statement perhaps for the Y and N bit ?
Try the following: