SELECT SUBSTRING_INDEX( email, '@' , -1 ) AS domain, COUNT( DISTINCT email ) AS count, COUNT( DISTINCT email ) /(
SELECT COUNT( DISTINCT email )
FROM `member`
WHERE email LIKE '%@%' ) *100 AS percent
FROM member
WHERE email LIKE '%@%'
GROUP BY 1
ORDER BY 2 DESC
LIMIT 10
.....
SELECT COUNT( DISTINCT email )
FROM `member`
WHERE email LIKE '%@%' ) *100 AS percent
FROM member
WHERE email LIKE '%@%'
GROUP BY 1
ORDER BY 2 DESC
LIMIT 10
转载请注明:谷谷点程序 » mysql 统计邮箱后缀占比情况