select class,count() from table group by class######回复 @lidexing : mysql下 select a.classid,b.counts from 分类表 a left join (select classid,counts from(select classid,count() as counts from 文章表 group by classid)tmp) b on a.classid=b.classid######分表的哦 一个是分类表 一个是文章表