I am running the following query
select * from Policy
where policynumber in
select policynumber from [Email]
where newsletteroptin = 'Y'
Source NOT IN ('CWS')
I also have tried removing source and I am still getting records those newsleter options are N.
The results which I am getting it's pulling everything from email table even records those newsletteroptin option is N and even sources those do contain CWS...
I want to pull all records from Policy table those have newsletter optin to Y but source is not equal to CWS.