为什么这个查询会出现错误"ORA-00904: invalid identifier"?

Why the error "ORA-00904: invalid identifier" appears in this query?

我构建了以下查询,但是当我尝试 运行 时它引发了错误:

ORA-00904: "CASE_MASTER"."FOLLOWUP_DATE":
           invalid identifier 00904. 00000 -  "%s: invalid identifier"
*Cause: 
*Action: Error at Line: 76 Column: 14

你能给我提示或告诉我哪里出了问题吗?

查询:

SELECT DISTINCT case_event_assess.case_id
  FROM case_event        ce
      ,case_event_assess
      ,lm_datasheet
      ,case_product      cp
      ,case_assess       ca
/* New AC Name: Exp: Testing query */
 WHERE ce.case_id = case_master.case_id
   AND ce.case_id = case_event_assess.case_id
   AND ce.seq_num = case_event_assess.event_seq_num
   AND case_event_assess.case_id = case_master.case_id
   AND ca.case_id = case_master.case_id
   AND ca.case_id = case_event_assess.case_id
   AND lm_datasheet.datasheet_id = case_event_assess.datasheet_id
   AND (sheet_name = 'IB' OR license_id = 0)
   AND ce.case_id = cp.case_id
   AND cp.seq_num = case_event_assess.prod_seq_num
   AND EXISTS (
        SELECT 1 FROM lm_product lp
         WHERE lp.drug_code = cp.co_drug_code
            OR lp.product_id = cp.pat_exposure )
   AND case_master.state_id > 1
   AND NOT EXISTS(
        SELECT DISTINCT case_event_assess.case_id
          FROM case_event_assess
         WHERE case_event_assess.case_id = case_master.case_id
           AND case_master.rpt_type_id IN (1, 3)
           AND EXISTS (
                SELECT 1 FROM lm_license
                 WHERE lm_license.license_id = case_event_assess.license_id
                   AND lm_license.country_id IN (223, 23000101)
                   AND lm_license.license_type_id IN (4, 6))
        )
   AND EXISTS(
        SELECT 1 FROM lm_license
               ,case_event_assess cea
         WHERE cea.case_id = case_master.case_id
           AND cea.prod_seq_num = case_event_assess.prod_seq_num
           AND cea.license_id = lm_license.license_id
           AND lm_license.manufacturer_id IN (10087, 200000016, 202000406, 202000608, 202000609)
           AND lm_license.country_id = 223 )
 GROUP BY case_event_assess.case_id
         ,case_event_assess.event_seq_num
         ,case_event_assess.prod_seq_num

HAVING(
(/* Serious */
MIN(ce.sc_death) = 1 OR MIN(ce.sc_threat) = 1 OR MIN(ce.sc_disable) = 1 OR MIN(ce.sc_int_req) = 1
 OR MIN(ce.sc_cong_anom) = 1 OR MIN(ce.sc_hosp) = 1 OR MIN(ce.med_serious) = 1 OR MIN(ce.sc_other) = 1
)
AND
( /* Unlisted*/
MIN(decode(lm_datasheet.datasheet_id, 0, 1, NULL, 1, abs(det_listedness_id - 2))) = 0
 OR MIN(decode(lm_datasheet.datasheet_id, 0, 3, NULL, 3, det_listedness_id)) = 3
))

因为在您的 from-子句中没有 table 调用 case_master,所以您不能在您的 where-子句中使用它。