我正在整理一个查询,该查询在很多情况下通过别名引用一个表,但随后它继续声明:
*ORA-00904: "MPAN_STATUS"."MPANCORE": 无效标识符 00904. 00000 - "%s: 无效标识符" *原因:
操作:错误行:43 列:126
查询如下:
SELECT readings.mpancore, mtds.meterid, (SELECT CASE
WHEN meter_type
LIKE 'RCAM%' AND
retrieval_method = 'R'
THEN 'TRUE'
ELSE 'FALSE' END
FROM edmgr.mtds
WHERE meter_removed IS NULL) "IS_SMART",
(SELECT CASE
WHEN flowversion = 'D0010' AND
readings.filename IS NOT NULL AND
readings.filedate >= mpan_status.ssd
THEN 'TRUE'
ELSE 'FALSE' END
FROM edmgr.readings, edmgr.mpan_status
WHERE readings.mpancore = mpan_status.mpancore) "D0010_RECEIVED",
(SELECT CASE
WHEN effective_from_date >= mpan_status.ssd AND
dc_id = mpan_status.confirmed_dc_id
THEN 'TRUE'
ELSE 'FALSE' END
FROM edmgr.D0019_reg, edmgr.mpan_status) "D0019_RECEIVED",
(SELECT CASE
WHEN file_date_time <= SYSDATE-409
THEN 'TRUE'
ELSE 'FALSE' END
FROM edmgr.D0019_reg) "RF_READ",
(SELECT CASE
WHEN file_date_time <= SYSDATE-220
THEN 'TRUE'
ELSE 'FALSE' END
FROM edmgr.D0019_reg) "R3_READ",
(SELECT CASE
WHEN file_date_time <= SYSDATE-118
THEN 'TRUE'
ELSE 'FALSE' END
FROM edmgr.D0019_reg) "R2_READ",
(SELECT CASE
WHEN file_date_time <= SYSDATE-56
THEN 'TRUE'
ELSE 'FALSE' END
FROM edmgr.D0019_reg) "R1_READ"
FROM edmgr.mpan_status "mpan_status" LEFT JOIN edmgr.D0019_reg "D0019" ON mpan_status.mpancore = D0019.metering_system_id
LEFT JOIN edmgr.readings "readings" ON mpan_status.mpancore = readings.mpancore
LEFT JOIN edmgr.mtds "mtds" ON readings.mpancore = mtds.mpancore
AND D0019.metering_system_id = mtds.mpancore
AND mtds.meterid = readings.meterid
我真的是一个完全的新手,所以任何帮助将不胜感激。