首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

这种条件判断如何写成一个函数

2013-01-19 
这种条件判断怎么写成一个函数。casewhend.ActionNo0 then awhend.ActionNo2 then bwhend.ActionNo1

这种条件判断怎么写成一个函数。
case
             when  d.ActionNo=0 then 'a'
             when  d.ActionNo=2 then 'b'
             when  d.ActionNo=1 then 'c'
             when  d.ActionNo=4 then 'd'
             when  d.ActionNo=6 then 'e'
             when  d.ActionNo=7 then 'f'
             when  e.LoanNm is null and d.ActionNo=8 then 'g'
             when  e.LoanNm is not null and d.ActionNo=8  then 'h'
               .
..........N个条件
             else ''
end

这种判断会反复调用,请问怎么写成一个函数呢?

热点排行