当我尝试添加约束时出现以下错误

I am getting following error when I try to add constraint

我需要找出 sfpl_plan_desc 中的哪些记录具有未通过特定 FK 的值。

ALTER TABLE SFPL_PLAN_DESC  ADD CONSTRAINT SFPL_PLAN_DESC_FK4 FOREIGN KEY ( DOC_TYPE ,  PLAN_TYPE , WORK_FLOW )  REFERENCES SFFND_DOC_TYPE_DEF


ERROR at line 1:
ORA-02298: cannot validate (SFMFG.SFPL_PLAN_DESC_FK4) - parent keys not found

简单,

Select distinct 
       DOC_TYPE
     , PLAN_TYPE
     , WORK_FLOW
  from SFPL_PLAN_DESC c
 where not exists (select 1 from SFFND_DOC_TYPE_DEF p
                    where p.doc_type = c.doc_type
                      and p.plan_type = c.plan_type
                      and p.work_flow = c.work_flow)

应该会显示丢失的外键。