在products表中,有product_id、product_name和category列,写一个查询获取每个类...
在products表中,有product_id、product_name和category列,写一个查询获取每个类别(category)下的产品数量。**** Hidden Message *****
SELECT category, COUNT(*) AS product_count
FROM products
GROUP BY category; select count(product_id) from products group by category SELECT category, COUNT(*) AS product_count
FROM products
GROUP BY category; SELECT category, COUNT(*) AS product_count
FROM products
GROUP BY category; SELECT category, COUNT(*) AS product_count
FROM products
GROUP BY category; select count(product_id) from products group by category
页:
[1]