Finding Conflicting Combinations Using SQL Say I have table called "Everyone_Loves_Relationships" which contains three fields: Boy_Name, Girl_Name, Relationship_Status. The list goes like this:

Boy_Name Girl_Name Relationship_Status
  Tony     Carol            No
  Simon    Julia            Yes
  Frank    Carol            No
  Frank    Lucy             No
  Frank    Lucy             No
  Tony     Lucy             No
  Tony     Samantha         Yes
  Frank    Carol            Yes


Each combination can show multiple times. 

You'll notice that Frank and Carol are showing twice, once with a Yes and once with a No.

How do I design a SQL request that checks for combinations of Boy_Name&amp;Girl_Name that have both a Yes and a No?

Thank you!
SELECT Boy_Name, Girl_Name
FROM Everyone_Loves_Relationships
GROUP BY Boy_Name, Girl_Name
HAVING COUNT(DISTINCT Relationship_Status) = 2


This query assumes that none another value (including NULL) is present in Relationship_Status field. If this is not true then replace the condition with

HAVING SUM(DISTINCT CASE WHEN Relationship_Status = 'Yes'
                         THEN 1
                         WHEN Relationship_Status = 'No'
                         THEN 2
                         ELSE 3
                         END) &lt; 3