SQL query to count and list the different counties per zip code
- by Chris
I have a sql server 2005 table called ZipCode, which has all the US ZIPs in it. For each entry, it lists the zip, county, city, state, and several other details.
Some zipcodes span multiple cities and some even span multiple counties. As a result, some zipcodes appear many times in the table.
I am trying to query the table to see which zipcodes…