设置SQL别名值

时间:2016-04-06 12:59:36

标签: sql sql-scripts

是否有办法通过检查其他列或者例如来设置别名isApprover的值(如果Control.ApproverIDProcess.TApprover有值,则将别名设置为true值)

以下是两列:

cast(case 
        when max(isnull(Process.TApprover,0)) = :MemberId 
           then 1 
           else 0 
     end as bit) as isApprover,

cast(case 
        when max(isnull(Control.ApproverID,0)) = :MemberId 
           then 1 
           else 0 
     end as bit) as isApprover, 

0 个答案:

没有答案