I have a query that is returning multiple records, these records come in pairs. Some of the info in the record pair columns is the same, ex ID and year, but other info has different values, ex column named type may be null on one and ‘A’ on another.
If this third column type is equal to ‘A’ or another arbitrary string for one of the pairs, how do I go about having it exclude both records with the same id and year in the WHERE section of the SQL query? I was thinking a case statement may be used but I’m not sure.
You can use NOT EXISTS and a subquery…