构建了一个子查询,但在 on 子句中获得了一个未知列。
SELECT *
FROM FINAL_Professional_SP_2013_BCARE_AllCOUNTS
INNER JOIN
(
SELECT COUNT(FINAL_Professional_SP_2013_BCARE_AllCOUNTS.Phy_PLN_CD), SUM(FINAL_MOP_Professional_SP_2013_BCARE.X12_Cost_High),
Total_Low-SUM(FINAL_MOP_Professional_SP_2013_BCARE.X12_Cost_Low),
Total_High-SUM(FINAL_MOP_Professional_SP_2013_BCARE.X12_Cost_High),
AVG_WITHIN_Fac-SUM(FINAL_MOP_Professional_SP_2013_BCARE.X12_Cost_Ave) FINAL_MOP_Professional_SP_2013_BCARE
FROM FINAL_MOP_Professional_SP_2013_BCARE, FINAL_Professional_SP_2013_BCARE_AllCOUNTS
GROUP BY FINAL_Professional_SP_2013_BCARE_AllCOUNTS.TC_Code, FINAL_Professional_SP_2013_BCARE_AllCOUNTS.Phy_PROV_NO
) a ON
FINAL_Professional_SP_2013_BCARE_AllCOUNTS.Phy_PROV_NO=FINAL_MOP_Professional_SP_2013_BCARE.Phy_PROV_NO
AND FINAL_Professional_SP_2013_BCARE_AllCOUNTS.TC_Code=FINAL_MOP_Professional_SP_2013_BCARE.TC_Code;
出现错误 - 错误代码:1054。“on 子句”中的未知列“FINAL_MOP_Professional_SP_2013_BCARE.Phy_PROV_NO”。我已将其更改为 a.Phy_PROV_NO',但得到相同的错误。