I have a query such as this:
select a.id, a.color, a.shade from colors a where a.color = 'red'
which fetches
ID | Color | shade
-------|------------|---------
23 |red | dark10
525 |red | light-10
Question:
How can I find all records in table colors where there are multiple (two) occurrences of samecolor AND their corresponding shades are NOT identical
e.g. records like the following will not be considered
ID | Color | shade
-------|------------|---------
23 |green | light-10
324 |green | light-10
You can do this by utilizing a GROUP BY clause with a HAVING COUNT(*) = 1 condition: