SQL错误:ORA-01799:列可能未外部联接到子查询

时间:2019-06-04 12:32:38

标签: sql oracle

我正试图离开表,但出现以下错误-

  

SQL错误:ORA-01799:列可能未外部联接到子查询   01799. 00000-“列不能外部连接到子查询”

我正在尝试在左侧联接中获取最大日期,如下所示。

 LEFT JOIN RAP10B Rap10B_R
  ON RAP10B_R.j44_pt_line_cat_cd  = rap01.j01_pt_line_cat_cd
  AND RAP10B_R.j44_pt_cdb_part_id = rap01.j01_pt_cdb_part_id
  AND RAP10B_R.j44_pt_state_cd    = rap01.j01_pt_state_cd
  AND RAP10B_R.plcy               = RAP01.plcy
  AND RAP10B_R.SCGCD              = '1'
  AND RAP10B_R.ICHAV              = 'N'
  and RAP10B_r.SCGCD              <> '3'
  and RAP10B_R.CLBRDT_t             = rap07.brthdt_T
  AND RAP10B_R.sprodt_t          <= tt.ja2_issuedt_t - 1
  AND (RAP10B_R.histdt_t          > tt.ja2_issuedt_t - 1
  OR RAP10B_R.histdt_s            = 0)
  AND bche1.NVU_WITHIN_EXPPER('C', rap01.state, rap01.co3, rap01.line3, tt.ja2_effdt_t, rap10b_r.lossdt_t, rap10b_r.clmsrc, '3') = 'Y'
  AND rap10b_r.schgdt_t           =
    (SELECT MAX(rap10b_r2.schgdt_t)
    FROM RAP10B Rap10B_R2
    WHERE RAP10B_R2.j44_pt_line_cat_cd = rap01.j01_pt_line_cat_cd
    AND RAP10B_R2.j44_pt_cdb_part_id   = rap01.j01_pt_cdb_part_id
    AND RAP10B_R2.j44_pt_state_cd      = rap01.j01_pt_state_cd
    AND RAP10B_R2.plcy                 = RAP01.plcy
    AND rap10b_r2.lossdt_t             = rap10b_r.lossdt_t
    AND rap10b_r2.clmnum               = rap10b_r.clmnum
    AND RAP10B_R2.sprodt_t            <= tt.ja2_issuedt_t - 1
    AND (RAP10B_R2.histdt_t            > tt.ja2_issuedt_t - 1
    OR RAP10B_R2.histdt_s              = 0)
    AND RAP10B_R2.SCHGDT_T            <= tt.ja2_effdt_t
    )

0 个答案:

没有答案