Reputation: 43
Im trying to obtain and count the number of accounts with a gmail domain. I'm unsure how to do it. Any help would be great.
Upvotes: 0
Views: 222
Reputation: 28741
SELECT COUNT(*) as numGmailAccounts
FROM tableName
WHERE emailColumn like '%gmail.com'
Upvotes: 2
Reputation: 204756
select sum(instr(some_column, '@gmail.com') > 0) as gmail_count
from your_table
Upvotes: 1