求一表中每一个类别共有几条记录数表如下: id lei 1 lei1 2 lei2 3 lei1 ... n lein 能不能用一sql语句,查出这个表中每一个lei有几条记录[解决办法]select lei,count(lei) as total from 表 group by lei