小case
declare   @Clx   table(id   int   identity,duan   int,bu   int,bu1   int,bu2   int,bu3   int) 
 declare   @ceng   int 
 --id为已知变量@ceng 
 declare   @c45   int 
 --现在根据@c45   的值更新表变量@Clx(@c45   值为0、1、2、3、4五者之一) 
 1.当@c45=0,不用处理 
 2.当@c45=1,对应id=@ceng行的列bu的值+1,列bu1的值+1 
 3.当@c45=2,对应id=@ceng行的列bu的值+1,列bu2的值+1 
 4.当@c45=3,对应id=@ceng行的列bu的值+1,列bu3的值+1 
 5.当@c45=4,对应id=@ceng行的列duan的值+1 
 --- 
 请教一个不使用if,只使用case的sql代码? 
------解决方案--------------------update @Clx set bu=case when @c45> 0 and @c45 <4 then bu+1 else bu end,   
                 bu1=case @c45 when 1 then bu1+1 else bu1 end, 
                 bu2=case @c45 when 2 then bu2+1 else bu2 end, 
                 bu3=case @c45 when 3 then bu3+1 else bu3 end, 
                 duan=case @c45 when 4 then duan+1 else duan end 
 where id=@ceng