Oracle 我的menu表中有三条数据,我想查询不同用户对不同菜单的最终权限,可是查询结果却是一个用户对一个菜单的各种权限,应该怎么改?
select users.name,
menu.name,
(bitand(substr(user_right.rights, 1, 1),
substr(group_right.rights, 1, 1)) +
substr(role_right.rights, 1, 1)) -
bitand(bitand(substr(user_right.rights, 1, 1),
substr(group_right.rights, 1, 1)),
substr(ROLE_RIGHT.RIGHTS, 1, 1)) as Q
from users
full join menu
on users.name = users.name
left join user_right
on user_right.rights = user_right.rights
left join group_right
on group_right.rights = group_right.rights
left join role_right
on role_right.rights = role_right.rights
![图片说明](https://img-ask.csdn.net/upload/201707/14/1500000136_482037.png)