SELECT * FROM CONTENT_PERM WHERE USERNAME IS NULL AND GROUPNAME IS NULL ; 插件 SELECT cp.ID, cp.CP_TYPE, cp.USERNAME, cp.GROUPNAME, cp.CPS_ID, cp.CREATOR, rest cp.CREATIONDATE, cp.LASTMODIFIER, cp.LASTMODDATE code FROM CONTENT_PERM cp ci WHERE cp.USERNAME IS NOT NULL AND cp.GROUPNAME IS NOT NULL ; get SELECT cps1.ID, cps1.CONTENT_ID, cps1.CONT_PERM_TYPE FROM CONTENT_PERM_SET cps1, CONTENT_PERM_SET cps2 it WHERE cps1.ID <> cps2.ID AND io cps1.CONTENT_ID = cps2.CONTENT_ID AND table cps1.CONT_PERM_TYPE = cps2.CONT_PERM_TYPE ORDER BY cps1.CONTENT_ID, cps1.CONT_PERM_TYPE, cps1.CREATIONDATE ASC ; SELECT cp.ID, cp.CP_TYPE, cps.CONTENT_ID, ( SELECT scps.ID FROM CONTENT_PERM_SET scps WHERE scps.CONTENT_ID = cps.CONTENT_ID AND scps.CONT_PERM_TYPE = cp.CP_TYPE) AS suggested_cps_id FROM CONTENT_PERM cp, CONTENT_PERM_SET cps WHERE cp.CPS_ID = cps.ID AND cp.CP_TYPE <> cps.CONT_PERM_TYPE; SELECT DISTINCT cp1.ID, cp1.CP_TYPE, cp1.USERNAME, cp1.GROUPNAME, cp1.CPS_ID, cp1.CREATOR, cp1.CREATIONDATE, cp1.LASTMODIFIER, cp1.LASTMODDATE FROM CONTENT_PERM cp1, CONTENT_PERM_SET cps1, CONTENT_PERM cp2, CONTENT_PERM_SET cps2 WHERE cp1.CPS_ID = cps1.ID AND cp2.CPS_ID = cps2.ID AND cp1.ID <> cp2.ID AND cps1.CONTENT_ID = cps2.CONTENT_ID AND cp1.CP_TYPE = cp2.CP_TYPE AND cp1.USERNAME = cp2.USERNAME ORDER BY cp1.CPS_ID, cp1.CP_TYPE, cp1.USERNAME, cp1.CREATIONDATE; SELECT DISTINCT cp1.ID, cp1.CP_TYPE, cp1.USERNAME, cp1.GROUPNAME, cp1.CPS_ID, cp1.CREATOR, cp1.CREATIONDATE, cp1.LASTMODIFIER, cp1.LASTMODDATE FROM CONTENT_PERM cp1, CONTENT_PERM_SET cps1, CONTENT_PERM cp2, CONTENT_PERM_SET cps2 WHERE cp1.CPS_ID = cps1.ID AND cp2.CPS_ID = cps2.ID AND cp1.ID <> cp2.ID AND cps1.CONTENT_ID = cps2.CONTENT_ID AND cp1.CP_TYPE = cp2.CP_TYPE AND cp1.GROUPNAME = cp2.GROUPNAME ORDER BY cp1.CPS_ID, cp1.CP_TYPE, cp1.GROUPNAME, cp1.CREATIONDATE; SELECT * FROM CONTENT_PERM_SET WHERE ID NOT IN ( SELECT DISTINCT CPS_ID FROM CONTENT_PERM); |