SELECT PTIASPRPTNO ,PTIASPSPVERS ,PTIASPRPTSUBJECT FROM PS_PTIASPRPTHEAD PT WHERE PTIASPRPTNO IN ( SELECT ptiasprptno FROM ps_eopm_supd_mnu ) UNION SELECT PTIASPRPTNO ,PTIASPSPVERS ,PTIASPRPTSUBJECT FROM PS_PTIASPRPTHEAD PT WHERE PTIASPRPTNO IN ( SELECT ptiasprptno FROM ps_eopm_supd_dtl ) UNION SELECT PTIASPRPTNO ,PTIASPSPVERS ,PTIASPRPTSUBJECT FROM PS_PTIASPRPTHEAD PT WHERE PTIASPRPTNO IN ( SELECT ptiasprptno FROM PS_EOPM_SUPD_RLE ) UNION SELECT DISTINCT ptiasprptno ,0 ,' ' FROM PS_EOPM_SUPD_DTL dtl WHERE NOT EXISTS ( SELECT 1 FROM ps_ptiasprpthead pt WHERE dtl.ptiasprptno = pt.ptiasprptno) UNION SELECT DISTINCT ptiasprptno ,0 ,' ' FROM PS_EOPM_SUPD_MNU dtl WHERE NOT EXISTS ( SELECT 1 FROM ps_ptiasprpthead pt WHERE dtl.ptiasprptno = pt.ptiasprptno) UNION SELECT DISTINCT ptiasprptno ,0 ,' ' FROM PS_EOPM_SUPD_RLE dtl WHERE NOT EXISTS ( SELECT 1 FROM ps_ptiasprpthead pt WHERE dtl.ptiasprptno = pt.ptiasprptno)
|