I am trying to figure out how to do this query. I have looked all over and with little sucess.
I have 2 tables one is called numbers the other is called area_code
Here is what they look like. I know that there will need to be substring(phoneNumbers,1,3)
Table: numbers
phoneNumber
4062081234
4062345453
2141234454
2101234555
Table: area_code
area_code state stateLong
214 TX Texas
210 TX Texas
406 MT Montana
Desired output:
stateLong count of phoneNumbers per state
Montana 2
Texas 2
Thank you so much for the help.