SELECT L.QRYNAME , L.LANGUAGE_CD , L.DESCR FROM PSQRYDEFN Q , PSQRYDEFNLANG L WHERE Q.OPRID = ' ' AND Q.QRYTYPE = 1 AND NOT EXISTS ( SELECT 'X' FROM PSQRYBIND B WHERE B.OPRID = Q.OPRID AND B.QRYNAME = Q.QRYNAME AND B.USECOUNT > 0) AND NOT EXISTS ( SELECT 'X' FROM PSQRYSELECT S WHERE S.OPRID = Q.OPRID AND S.QRYNAME = Q.QRYNAME AND S.SELECTTYPE IN (1, 3) AND NOT EXISTS ( SELECT 'X' FROM PSQRYRECORD R WHERE R.OPRID = S.OPRID AND R.QRYNAME = S.QRYNAME AND R.SELNUM = S.SELNUM AND R.JOINTYPE = 1 AND R.RECNAME = 'BO_BASIC_IND')) AND L.OPRID = Q.OPRID AND L.QRYNAME = Q.QRYNAME
|