I have a table in a denormalized form like below:
Col1 Col2 Col3 Col4 Col5
Paris France Europe 1 4
Paris France Europe 2 5
Paris France Europe 3 6
Washington D.C. USA North America 8 9
Washington D.C. USA North America 7 7
many more rows
You can use aggregation:
select col3, count(*), count(distinct col2); from t group by col3;
The expectation is that the second column would have a value of "1". You could get all examples with multiple values in
col2 by using
having count(distinct col2) > 1.
Of course, cities do have the same name. Paris, for instance, is a rather well-known city in Texas.