sql - Need a query to count number of times a customer visits each region -
i have table has account_number field , region field, looks this:
account_number ... region 12345678 region1 12345667 region2
i need count number of times account number visits each region, output like:
account_number ... nbr_visits ... region 12345678 3 region 4 45678923 6 region 2
so, account number can occur multiple times if customer visits different regions in same month. isn't way have set up, 3rd party requiring format , i'm not sure best way go it. i'm using ms access 2010.
select account_number,region,count(*) nbr_visits mytable group account_number,region
Comments
Post a Comment