51Testing软件测试论坛

标题: 在products表中,有product_id、product_name和category列,写一个查询获取每个类... [打印本页]

作者: 测试积点老人    时间: 7 天前
标题: 在products表中,有product_id、product_name和category列,写一个查询获取每个类...
在products表中,有product_id、product_name和category列,写一个查询获取每个类别(category)下的产品数量。


作者: kallinr    时间: 6 天前
SELECT category, COUNT(*) AS product_count
FROM products
GROUP BY category;
作者: oliver.tang    时间: 6 天前
select count(product_id) from products group by category
作者: 海海豚    时间: 6 天前
SELECT category, COUNT(*) AS product_count
FROM products
GROUP BY category;
作者: jingzizx    时间: 6 天前
SELECT category, COUNT(*) AS product_count
FROM products
GROUP BY category;
作者: 你好浮戈    时间: 6 天前
SELECT category, COUNT(*) AS product_count
FROM products
GROUP BY category;
作者: litingting0214    时间: 6 天前
select count(product_id) from products group by category




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2