-
I feel like a complete retard, but I need help with this SQL statment ASAP...
I want to show all of the zip codes in a table DISTINCT(zipcode) and then how many occurrances of each zip code exist in that table. Can someone who is a SQL gangster pls help me!
This query is for MS Access 2000, so Access friendly SQL would be appreciated.
-
here is the SQL statement straight out of Access (using the Biblio.mdb that ships with VB)
Code:
SELECT Publishers.Zip, Count(Publishers.Zip) AS CountOfZip
FROM Publishers
GROUP BY Publishers.Zip;
You can right click in the Query creation table and select Totals change the one you want to count to 'count' and the rest to 'group by' if you want to show the zip and the count then make to spots for zip one with count one with group by.
KEY info if other info is in the query (like Customer name) that shares the zip but not the other info it will NOT be counted as the same zip.
That should give you some direction.