Hopefully an easy problem for an experienced SQL person. I have an application which uses SQL Server, and I cannot perform this query in the application, so I'm hoping to back-door it, but I need help.
I have a table with a large list of emails and all its metadata. I'm trying to find email that is only between parties of this one company and flag them.
What I did was search where companyName.com
is in To
and From
and marked a TagField
as 1
(I did this through my application's front end).
Now what I need to do is search where any other possible values, ignoring companyName.com
exist in To
and From
where I've already flagged them as 1 in TagField
. From
will usually just have one value, but To
could have multiple, all formatted differently, but all separated by a semi-colon (I will probably have to apply this same search to CC and BCC columns, too).
Any thoughts?