我不明白为什么我收到错误
“指定字段 qb2.WellworkOIL 可以引用 SQL 语句中 FROM 子句中列出的多个表”
根据下面的查询
SELECT
qb1.CompanyName,
qb1.AssetName,
qb1.Year,
IIf(qb1.PrimaryProductionType='Oil',
qb2.WellworkOIL,
IIF(qb1.PrimaryProductionType='Gas',
qb3.WellworkGAS,
qb4.WellworkOilGas)) AS Selected
FROM
(
(
PEBaseQueryConditions AS qb1
INNER JOIN PE_Field_WellworkOIL AS qb2
ON (qb1.Year=qb2.Year) AND (qb1.AssetName=qb2.AssetName)
)
INNER JOIN PE_Field_WellworkGAS AS qb3
ON (qb1.Year=qb3.Year) AND (qb1.AssetName=qb3.AssetName)
)
INNER JOIN PE_Field_WellworkOILGAS AS qb4
ON (qb1.Year=qb4.Year) AND (qb1.AssetName=qb4.AssetName)
GROUP BY
qb1.CompanyName,
qb1.AssetName,
qb1.Year,
qb1.PrimaryProductionType,
qb2.WellworkOIL,
qb3.WellworkGAS,
qb4.WellworkOilGas;