组合权限查询 SQL,UniGUI

组合权限查询 SQL,UniGUI:

   name ,View, New, Edit, Dele      表 获取 name 的 授权。

   项目         1       0       0      0

   项目         1      0       0       1  

   合同         1      1       0      0

   合同         1      0       0      1

=========================    

 方式1:select name, max(case when b=1 then 1 else 0 end) as b , max(case when c=1 then 1 else 0 end) as c from test
group by name 
 
方式2: select name, max(case b when 1 then 1 else 0 end) as b , max(case c when 1 then 1 else 0 end) as c from test
group by name 

猜你喜欢

转载自www.cnblogs.com/hopesun/p/9082364.html