Firstly, thanks in advance for any assistance, it is much appriciated.
I have two tables, structure as follows:
TBL_FANS
Column | Example
--------------------------------------
Fan_ID | 256
Code_Prefix | ABC
Email | email@hotmail.com
Postcode | 2015
--------------------------------------
TBL_POSTCODES
Column | Example
--------------------------------------
Postcode | 2015
State | NSW
--------------------------------------
I need to get a count of what state all of the fans are in so that I can use this data in a charting package to show the location of the fans. The data will need to be in this format
State | Count
--------------------------------------
NSW | 125
QLD | 75
VIC | 100
Other | 20
If the query does not find a match to the Fans Postcode in TBL_POSTCODES then it should be added to a new row named other.
Any ideas on how I go about accomplishing this?