T-SQL Anti-Patterns: Non-SARGable ORs In Joins

Our last anti-pattern had us discussing unnecessary repetition of queries, but this time, I'm going to hit the opposite problem:  trying to merge two queries which should remain separate. Let's start with an example of a query.  This is a simplified version of a query which I ran into at a prior job: There's nothing…

Advertisement