Reputation: 1449
I have a table Tzipcode which has fields 'zipcode','cityName','country' etc. Some zipcodes are repeating, in the sense same Zipcode for more than one city.
I want to find out those zipcodes that exist more than once in the table. Also those zipcodes that exist more than twice.
Database: Sybase ASE
Upvotes: 1
Views: 5957
Reputation: 21536
Try something like
Select zipcode, count(cityName) from Tzipcode group by zipcode having count(cityName) > 1
Upvotes: 1