T-SQL Conditional WHERE Clause
I changed the query to use EXISTS because if there’s more than one location associated with a POST, there’d be duplicate POST records that’d require a DISTINCT or GROUP BY clause to get rid of… The non-sargable This will perform the worst of the possible solutions: SELECT p.* FROM POSTS p WHERE EXISTS(SELECT NULL FROM … Read more