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? 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... 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. Link to comment https://forums.phpfreaks.com/topic/253724-is-this-query-possible/#findComment-1300750 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.