I have a database of customers (MS Access database) and I am trying to check out the demographics. I would like to list the top 5 cities and their count (how many times this city is found in my database), as well as the top 5 postal codes and their count as well.
I can do a count on the select string "SELECT * FROM ContactInfo WHERE City ='Toronto'", but in my case I do not know the names of the top 5 cities.
I am assuming that I would have to iterate through my database and list all of the unique cities and save that to an array or a list of some sort, and then I would have to do a count on each of those city names. This sounds like a lot of processing power, but maybe there is a simpler way of doing this that I am just not seeing.
Any help would be much appreciated.