SELECT A.EOQF_QSTNRINSTANCE ,A.EOQF_KEY_VALUE ,B.EOQF_KEY_VALUE FROM (PS_EOQF_QSTNRCNTXT A LEFT OUTER JOIN PS_EOQF_QSTNRCNTXT B ON A.EOQF_QSTNRINSTANCE=B.EOQF_QSTNRINSTANCE AND B.EOQF_KEY_FIELDNAME='EOQF_EVENT_ID' ) WHERE A.EOQF_KEY_FIELDNAME='OPRID' UNION SELECT A.EOQF_QSTNRINSTANCE ,M.MESSAGE_TEXT ,' ' FROM PS_EOQF_QUESTIONRE A , PSMSGCATDEFN M WHERE M.MESSAGE_SET_NBR=18111 AND M.MESSAGE_NBR=3221 AND NOT EXISTS ( SELECT 'X' FROM PS_EOQF_QSTNRCNTXT B WHERE B.EOQF_QSTNRINSTANCE=A.EOQF_QSTNRINSTANCE)
|