Excluding records based upon a one to many SQL join

Posted by tequila2k on Stack Overflow See other posts from Stack Overflow or by tequila2k
Published on 2010-04-08T09:30:59Z Indexed on 2010/04/08 9:33 UTC
Read the original article Hit count: 100

Filed under:
|

How would I write a SQL query that excludes a record if one (external) record from a one to many join matches a certain condition?

For example:

Details
ID      
1         
2         

Items
DetailID    Item
1           A
1           B
2           B
2           C

How would I select the detail records where the Items do not include 'A'?

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server