So i have this table A:
color ID MODEL ----------------------------- red | 10 | HONDA blue | 10 | TOYOTA red | 15 |
This query returns all the IDs where the COLOR is red or blue but not both.
select id , color from your_table where color in ('red', 'blue') and id in ( select id from your_table where color in ('red', 'blue') group by id having count(*) = 1)