码迷,mamicode.com
首页 > 数据库 > 详细

组合权限查询 SQL,UniGUI

时间:2018-05-24 13:58:36      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:case   test   rom   select   The   ==   max   UI   ase   

组合权限查询 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 

 

组合权限查询 SQL,UniGUI

标签:case   test   rom   select   The   ==   max   UI   ase   

原文地址:https://www.cnblogs.com/hopesun/p/9082364.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!