I have a table in Postgres as below :
Key Value
1234 QAB009
1234 QAB009
1234 QAB010
1235 QAB011
1236 QAB012
1236 QAB012
1236 QAB013
I want output something similar to this , only values which are repeated more than once for a certain key
Key Value
1234 QAB009
1236 QAB012
Appreciate any help!
>Solution :
You can use simple aggregation with a having filter:
select key, value
from t
group by key, value
having Count(*) > 1;