There are two cases. Say you have data
ABC (columns) ab c1 ab c2
Taking different values ββof A, B, gives only one result (a, b), having two values ββfor column C. Therefore, the question arises, do you want to see all the values ββof C or only one value for each individual value of columns A and B?
If you want to see only one C value, you can write
SELECT A, B, MAX(C) FROM YourTable GROUP BY A, B
On the other hand, if you want to see all the values ββfor C, then
SELECT DISTINCT A, B, C FROM YourTable WHERE ROW(A,B) IN (SELECT A, B FROM YourTable GROUP BY A, B)
gives you that. This last alternative is necessary if there are other columns in the table.
mdma source share