I'm working with mysql and I want to find the most common email suffixes in my database.
Example Dataset:
bob@gmail.com
billyboy@gmail.com
Kimberly@gmail.com
jimbob@yahoo.com
jimbo@yahoo.com
Bob@hotmail.com
Kyle@aol.com
I would want output of:
gmail.com - 3
yahoo.com - 2
hotmail.com - 1
aol.com - 1
My first instinct is to run this sql command, "SELECT userEmail FROM email_user_testing"
then run a loop and manipulate the data with PHP, but I have a feeling it'd be much more efficient to use a sql command.