日期:2014-05-18 浏览次数:21079 次
select a.FunctionCode as 功能代码,FunctionName as 功能名称, case when b.RoleCode = 'admin' then 1 else 0 end as Flag from AFunction a left join ARoleFunction b on a.FunctionCode=b.FunctionCode where ModuleName='SysAdmin'
select a.FunctionCode as 功能代码,a.FunctionName as 功能名称, Flag=case when b.RoleCode = 'admin' then 1 else 0 end from from AFunction a left join ARoleFunction b on a.FunctionCode=b.FunctionCode and b.RoleCode='admin' where a.ModuleName='SysAdmin'
------解决方案--------------------
select a.FunctionCode as 功能代码,FunctionName as 功能名称, case when b.RoleCode = 'admin' then 1 else 0 end as Flag from AFunction a left join ARoleFunction b on a.FunctionCode=b.FunctionCode where ModuleName='SysAdmin' and b.RoleCode='admin'
------解决方案--------------------
select a.FunctionCode as 功能代码,FunctionName as 功能名称,case when b.RoleCode = 'admin' then 1 else 0 end as Flag from AFunction a left join ARoleFunction b on a.FunctionCode=b.FunctionCode where a.ModuleName='SysAdmin' and b.RoleCode='admin' //这句话应该是要加上去的.前面少了一个a.