SELECT G.CLASSID , D.TL_GROUP_ID , D.DESCR FROM PS_TL_GROUP_TBL D , PS_TL_GRP_PARM_TBL T , PSCLASSDEFN G WHERE (D.TL_GROUP_ID = T.TL_GROUP_ID OR NOT EXISTS ( SELECT 'X' FROM PS_TL_GRP_PARM_TBL T1 WHERE T1.TL_GROUP_ID = D.TL_GROUP_ID)) AND D.GROUP_TYPE_IND = 'S' GROUP BY G.CLASSID, D.TL_GROUP_ID, D.DESCR HAVING COUNT(*) = ( SELECT COUNT(*) FROM PS_TL_GRP_PARM_TBL A , PS_TL_GRP_FLD_SEC B WHERE B.ROWSECCLASS = G.CLASSID AND A.TL_GROUP_ID = D.TL_GROUP_ID AND A.RECNAME = B.RECNAME AND A.FIELDNAME = B.FIELDNAME AND B.ACCESSIBLE = 'Y') OR 0 = ( SELECT COUNT(*) FROM PS_TL_GRP_PARM_TBL C WHERE C.TL_GROUP_ID = D.TL_GROUP_ID)
|