Find Customers Who Bought "A" and "B" But Not "C" (SQL Spackle)

Posted on SQL Server Central See other posts from SQL Server Central
Published on Thu, 29 Mar 2012 06:00:00 UT Indexed on 2012/04/04 23:40 UTC
Read the original article Hit count: 120

Filed under:

A simple problem that can become complex in T-SQL. How do you find the rows that match 2 conditions, but not a third, in an efficient manner. MVP Jeff Moden gives us a solution.

SQL Monitor What are your servers really trying to tell you?
Find out with new SQL Monitor 3.0, an easy-to-use
tool built for no-nonsense database professionals.
For effortless insights into SQL Server,
download a free trial today.

© SQL Server Central or respective owner