I know the answer will probably be really simple but I just can't see it :pinch:. I would like to select only the tuples from column X that have two or more occurrences of different values in column Y.
As a sample table:
X | Y
id1 M1
id2 M2
id2 M2
id1 M2
So the desired result would be:
X
id1
Since id1 is the only entry in X that has two different values in Y.
Something like:
SELECT DISTINCT x FROM table WHERE [??] > 1;
But I can't think of the expression that would work. :wacko:
Question
Minchino
I know the answer will probably be really simple but I just can't see it :pinch:. I would like to select only the tuples from column X that have two or more occurrences of different values in column Y.
As a sample table:
X | Y
id1 M1
id2 M2
id2 M2
id1 M2
So the desired result would be:
X
id1
Since id1 is the only entry in X that has two different values in Y.
Something like:
SELECT DISTINCT x FROM table WHERE [??] > 1;
But I can't think of the expression that would work. :wacko:
Edited by MinchinoLink to comment
Share on other sites
2 answers to this question
Recommended Posts