角色模板批量授SQL方法

SELECT
DISTINCT S.F6894 模板ID,S.F6895 权限编号,部门组合ID = ‘,’+(stuff((SELECT DISTINCT ‘,’ + CAST(F6892 AS VARCHAR(100))
FROM tabDIYTable798 WHERE F6894= s.F6894 AND F6895=s.F6895 FOR xml path (”)),1,1,”))+’,’
,角色组合ID =’,’+(stuff((SELECT DISTINCT ‘,’ + CAST(F6893 AS VARCHAR(100))
FROM tabDIYTable798 WHERE F6894= s.F6894 AND F6895=s.F6895 FOR xml path (”)),1,1,”))+’,’
FROM
tabDIYTable798 s
GROUP BY s.F6894,s.F6895,S.F6892,S.F6893

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。