日期:2014-05-17 浏览次数:21075 次
select count(*) as emailcount from [user]
------解决方案--------------------
不是很明白你的意思,但我猜,你的意思是不是说要统计,字段里面各邮箱地址后缀相同的邮箱地址总数,比如,有多少个是63.com的邮箱,有多少是hotmail.com的邮箱,有多少是126.com的邮箱,等等,是不是这个意思啦
------解决方案--------------------
晕。。。更新慢了点,发错了。。。
------解决方案--------------------
单独用SQL语句比较麻烦
dim a = "@126.com"
sql = "select count(id) from ta where instr(email,"&a&")>0" 'ACCESS数据库
sql = "select count(id) from ta where CHARINDEX("&a&",email)>0" 'SQL数据库
------解决方案--------------------
那可能要用 like 了
------解决方案--------------------
看看这个是不是符合你的要求:
select count(*)as EamilCount,email from [User] group by [email]
------解决方案--------------------
读取出来 再用ASP统计不行吗? dim rs,aMCount(),iMType,aMList(),sMail,n,iHave iMType=-1 set rs = Cn.execute("Select email From list") do until rs.Eof sMail = lcase(split(rs(0),"@")(ubound(split(rs(0),"@")))) iHave = -1 for n = 0 to iMCount if aMList(n) = sMail then iHave = n exit for end if next if -1 = iHave then iMType = iMType + 1 redim Preserve aMCount(iMType) redim Preserve aMList(iMType) aMCount(iMType) = 1 aMList(iMType) = sMail else aMCount(iHave) = aMCount(iHave) + 1 end if rs.movenext loop set rs = nothing
------解决方案--------------------
如果注册的用户数达到一定程度,我们可以在数据库查询语句对其进行统计。
以下SQL语句能够统计出带某种类型后缀的email邮件注册量最大,及其排行顺序。
SELECT suffix_email, COUNT(suffix_email) AS email_count
FROM (SELECT SUBSTRING(email, CHARINDEX('@', email), 100) AS suffix_email
FROM user_table) temp_table
GROUP BY suffix_email
HAVING (COUNT(suffix_email) > 5)
ORDER BY email_count DESC
某网站对此排名后,发现排名前15的邮箱如下:
@163.com
@126.com
@sina.com
@yahoo.com.cn
@sohu.com
@hotmail.com
@tom.com
@21cn.com
@263.com
@vip.sina.com
@yahoo.com
@163.net
@qq.com
@gmail.com
@eyou.com
------解决方案--------------------
如果注册的用户数达到一定程度,我们可以在数据库查询语句对其进行统计。
以下SQL语句能够统计出带某种类型后缀的email邮件注册量最大,及其排行顺序。
SELECT suffix_email, COUNT(suffix_email) AS email_count
FROM (SELECT SUBSTRING(email, CHARINDEX('@', email), 100) AS suffix_email
FROM user_table) temp_table
GROUP BY suffix_email
HAVING (COUNT(suffix_email) > 5)
ORDER BY email_count DESC
某网站对此排名后,发现排名前15的邮箱如下:
@163.com
@126.com
@sina.com
@yahoo.com.cn
@sohu.com
@hotmail.com
@tom.com
@21cn.com
@263.com
@vip.sina.com
@yahoo.com
@163.net
@qq.com
@gmail.com
@eyou.com