求一表中每一个类别共有几条记录数

select   lei   ,count(lei)   as   num   from   表   group   by   lei
原文地址:https://www.cnblogs.com/studio313/p/2036067.html