Question : Get rows with MAX counts - SQL Server 2000

Brain freeze must be setting in. This should be easy.

I have a table with ACCT_NBR, ZIP, COUNTY. It is normally used to provide a COUNTY for an account. I now have a scenario where I do not have the account, but want to build a table from this one where I can use ZIP to provide a COUNTY. However, there can be more than one county assigned to a ZIP, so I want to create single row in my sub-table for each ZIP based on how many rows there are in the source table.

If I run the query:
1:
SELECT ZIP, COUNTY, COUNT(*) FROM tbl1 GROUP BY ZIP, COUNTY

and it returns
1:
2:
3:
4:
5:
92111  county1    12
92111  county2   145
92123  county2   108
92123  county3   110
92123  county4     5 


Then my resultant table shoud have

1:
2:
92111  county2
92123  county3


If there are ties, then I would just pick on. Again, this is SQL Server 2000.

Answer : Get rows with MAX counts - SQL Server 2000

Hi,

You need to set to Bridge mode the modem!
And you need to set the PIX to pppoe mode:

http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/products_configuration_example09186a00801055dd.shtml
Random Solutions  
 
programming4us programming4us