日期:2014-05-18 浏览次数:20665 次
select @k = case right(@i,2) when 1,2,6,11 then 26 when 3,4,10 then 27 else 28 end
------解决方案--------------------
我觉得用if else会更好点
------解决方案--------------------
select 100+number as col1, case when right(100+number,2) in (1,2,6,11) then 26 when right(100+number,2) in (3,4,10) then 27 else 28 end as col2 from master..spt_values where type='p' and number <15 /* col1 col2 ----------- ----------- 100 28 101 26 102 26 103 27 104 27 105 28 106 26 107 28 108 28 109 28 110 27 111 26 112 28 113 28 114 28 */