paraphs i'm stupid...
based the 20 REGIONI how to count PROVINCE for each REGIONI?
for example for REGIONE=CAMPANIA have five distinct PROVINCE
to the and of query:
CAMPANIA 5
LAZIO 5
COUNT province by regione
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
COUNT province by regione
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78481
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: COUNT province by regione
Like this:
SELECT REGIONE, COUNT(PROVINCIA) AS CONTADIPROVINCIA FROM (SELECT DISTINCT REGIONE, PROVINCIA FROM [www-zip-codes-maps-com]) GROUP BY REGIONE
SELECT REGIONE, COUNT(PROVINCIA) AS CONTADIPROVINCIA FROM (SELECT DISTINCT REGIONE, PROVINCIA FROM [www-zip-codes-maps-com]) GROUP BY REGIONE
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36