johnsmith153 Posted December 23, 2011 Share Posted December 23, 2011 I have phone numbers (field name:telephone / varchar) in a table. "555-444-3333" "717-333-3211" I want to count the amount that have the same area code: "SELECT COUNT(*) FROM table GROUP BY the first three digits of telephone field" Is it possible? Quote Link to comment https://forums.phpfreaks.com/topic/253724-is-this-query-possible/ Share on other sites More sharing options...
requinix Posted December 23, 2011 Share Posted December 23, 2011 Try LEFT... Quote Link to comment https://forums.phpfreaks.com/topic/253724-is-this-query-possible/#findComment-1300745 Share on other sites More sharing options...
johnsmith153 Posted December 23, 2011 Author Share Posted December 23, 2011 Perfect. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/253724-is-this-query-possible/#findComment-1300750 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.