【发布时间】:2021-09-25 04:44:04
【问题描述】:
SELECT
category_id,
product_size,
category_name,
SUM(product_quantity) AS total_quantity
FROM tbl_categories_quantity -- (table-1)
INNER JOIN tbl_categories USING (category_id)
GROUP BY category_id,product_size
上面的代码在一个表中工作,我想添加下面不起作用的代码(第二个表)
SELECT
category_id,
product_size,
SUM(product_sell) AS total_sell
FROM tbl_product_sell -- (table-2)
GROUP BY category_id,product_size;
【问题讨论】:
-
类别 1 的多个值,其中其他值是唯一的。有可能吗?
-
添加了额外的截图#Rahul Biswas
-
请检查我下面的答案。
-
#Mr. Rahul Biswas 你的重播帖子不见了。
-
我的帖子对你有帮助吗?请在下面查看我的查询。