select category.categoryName, count(item.itemID) as YOUR_COUNT from category, item where item.categoryID = category.categoryID group by category.categoryID
lichao
2013-07-09 17:16:13 +08:00
select category.categoryID, count(item.itemID) as YOUR_COUNT from category, item where item.categoryID = category.categoryID group by category.categoryID
cdfmr
2013-07-09 17:19:35 +08:00
select category, count(*) from item group by category,将此临时表与category表做联合查询。