读书人

权限求和?(有点难度) 谁来指点

发布时间: 2012-01-11 22:28:46 作者: rapoo

权限求和??(有点难度) 哪位高手来指点
说明:
--FIdSYRole(角色ID),FunctionCode(模块代码),add(增加权限 1表示有,0表示没有权限)

问题;
  我现在要求角色ID为6,7的权限并集

数据:
drop table [dbo].[SY_RoleOper]
GO

CREATE TABLE [dbo].[SY_RoleOper] (
[FId] [PKId] NOT NULL ,
[FIdSYRole] [FKID] NOT NULL ,
[FunctionCode] [varchar] (30) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[add] [bit] NULL ,
[edit] [bit] NULL ,
[del] [bit] NULL ,
[browse] [bit] NULL ,
[print] [bit] NULL ,
[check] [bit] NULL
) ON [PRIMARY]
GO


insert into SY_RoleOper values(350,6, 'clientRecord ',0,1,0,1,1,0)
insert into SY_RoleOper values(351,7, 'clientRecord ',0,1,0,1,1,0)
insert into SY_RoleOper values(352,8, 'clientRecord ',1,1,0,1,1,1)
insert into SY_RoleOper values(353,6, 'linkman ',0,1,0,1,1,0)
insert into SY_RoleOper values(353,7, 'linkman ',1,1,0,1,1,1)

结果
   'clientRecord ',0,1,0,1,1,0
'linkman ',1,1,0,1,1,1

哪位高手来指点

[解决办法]
'clientRecord ',0,1,0,1,1,0
为什么不是
'clientRecord ',1,1,0,1,1,1

应该or关系

读书人网 >SQL Server

热点推荐