目前,我写了:
SELECT IT_ID, SUBSTR (SYS_CONNECT_BY_PATH (grp , , ), 2) GROUPS
FROM (SELECT U.IT_ID, LAST_NAME, FIRST_NAME, GRP, ROW_NUMBER() OVER (ORDER BY U.IT_ID) rn, COUNT(*) OVER() cnt
FROM ECG_IT_USERS U
JOIN SECUREGROUPS G ON U.IT_ID = G.IT_ID)
START WITH rn = 1
CONNECT BY rn = PRIOR rn + 1
这一回报:
IT_ID GROUPS
afz23 ADMIN
afz23 ADMIN,QA
alv77 ADMIN,QA,USER
jaj23 ADMIN,QA,USER,USER
klo26 ADMIN,QA,USER,USER,PROD
klo26 ADMIN,QA,USER,USER,PROD,ADMIN
klo26 ADMIN,QA,USER,USER,PROD,ADMIN,QA
mav45 ADMIN,QA,USER,USER,PROD,ADMIN,QA,ADMIN
我可以说明我如何在遇到新用户后重新启用? 看来,尽管用户不属于前几组人,但该组仍继续工作。
I need to see:
IT_ID GROUPS
afz23 ADMIN,QA
alv77 USER
jaj23 USER
klo26 PROD,ADMIN,QA
mav45 ADMIN