【发布时间】:2026-01-05 05:20:03
【问题描述】:
我正在使用这两个 select 语句,并希望将它们合并为一个。有没有人有什么建议。但是,问题是我正在使用访问权限,并且访问权限中没有 case 子句。
SELECT
Table_1.Table_Identification_Number,
AVG (Table_2.Coulmn-2) AS avg_attribute
FROM
Table_1 JOIN
Table_2 ON Table_1.Table_Identification_Number = Table_2.Table_Identification_Number
WHERE
Table_2.Column-3='1'
GROUP BY
Table_1.Table_Identification_Number
SELECT
Table_1.Table_Identification_Number,
AVG (Table_2.Coulmn-2) AS avg_attribute
FROM
Table_1 JOIN
Table_2 ON Table_1.Table_Identification_Number = Table_2.Table_Identification_Number
WHERE
Table_2.Column-3='2'
GROUP BY
Table_1.Table_Identification_Number
【问题讨论】:
-
请提供样本数据和期望的结果。此外,修复数据库标签以确保您的数据库准确无误。