-2

我的类别是未知的(动态的)。我想获取每个类别中的记录计数以及该计数的类别名称以在图中实现。有什么建议吗?

4

3 回答 3

4
 select count(*) as cat_count, category from table_name group by category
于 2013-06-05T19:14:08.097 回答
2
 select count(*), category from <table> group by category
于 2013-06-05T19:12:31.577 回答
0
select count(id) as count, category_name from category group by category_name
于 2013-06-05T19:17:34.693 回答