经典sql语句,统计用户表中邮箱类别和数量

select count(id) as idcount,substring(email,(LOCATE( '@',email)+1)) from users where created < '2010-01-13 00:00:00' group by substring(email,(LOCATE( '@',email)+1)) order by idcount desc ;

本文出自 “运维工作记录” 博客,转载请与作者联系!

你可能感兴趣的:(sql,数据库,职场,休闲)