人员账号所属权限模块

select distinct

a.编码 as 部门编号,

a.名称 部门,

B.编号 as 人员编号,

b.姓名,

d.用户名,

substr(t.角色, 4, 20) as 角色,t.标题, t.说明,t.功能

from 部门表 a,

人员表 b,

部门人员 c,

上机人员表 d,

dba_role_privs e,

dba_roles f,

(select g.角色, h.序号, h.标题, h.说明, h.系统,G.功能

from (select distinct 系统, 序号, 角色,功能 from zltools.zlrolegrant) g,

zltools.zlprograms h

where g.序号 = h.序号

and h.系统 is not null) t

where e.granted_role = f.role

and f.role like '%ZL_%'

and a.id = c.部门id

and b.id = c.人员id

and b.id = d.人员id

and e.grantee = d.用户名

and f.role = t.角色

and C.缺省=1

And C.部门ID /*B0*/is not null/*E0*/

order by 部门编号,人员编号

相关推荐
这个DBA有点耶8 小时前
NULL不是空——数据库里最反直觉的设计,90%新人踩过的坑
数据库·mysql·代码规范
这个DBA有点耶10 小时前
AI写的SQL跑崩了生产库,这锅谁背?
数据库·人工智能·程序员
镜舟科技10 小时前
Databricks 再提 LTAP,AI 时代的数据底座为何重回大一统叙事?
数据库·架构·agent
Databend11 小时前
从湖仓升级为 Agent 时代的数据控制面,Snowflake 和 Databricks 有哪些布局
大数据·数据库·agent
ClouGence15 小时前
SQL Server CDC 能放到 Always On 备库读吗?一文讲透原理与实践
数据库·sql server
先吃饱再说1 天前
存储的进化:从 MySQL 到浏览器缓存,数据到底住在哪?
数据库
Nturmoils1 天前
字段太多看不全,ksql 的展开模式和输出控制怎么用
数据库·后端
Databend1 天前
Agent 轨迹分析与归因的数据工程实践
大数据·数据库·agent
这个DBA有点耶1 天前
SQL改写进阶:标量子查询的“隐形代价”与消除实战
数据库·mysql·架构
smallyoung1 天前
数据库乐观锁深度解析:MySQL、PostgreSQL 实战 + Spring Boot 集成指南
数据库·mysql·postgresql