Hi,
I'm looking to build a sql query that will filter for IDs where the IDs are in multiple rows each with different emails and email source codes and want to test whether any of the source codes match a certain value and not include those in the output dataset. I have attached a document with an example
For example, say column A has ID "1" and has 3 rows of data. Each row has a different email address and a different source code. The first row has email1 and source code of "A", the second row has email2 and source code of "I", and the 3rd row has no email or source code. In this case, I want to test if ID 1 has any source code of "A" and exclude the ID in the output dataset because it includes the value of "A".
Alternatively, let's say there is another ID of "4" with 3 rows. The first row has email1 and source code of "I", the second row has email2 and source code of "Q", and the third row has no email or source code. In this case, because none of the rows for ID of "4" has a value of "A", I want to INCLUDE it in my output dataset.
SQL Data sample.xlsx (10.24 KB)
Thanks,
Pierre