应该是 case a>b then .. else ...end 

解决方案 »

  1.   

    條件判斷可以,但賦值不可以.   if  條件1
        begin
         .....
        end
       if  條件2
         begin
          .......
         end
      .........要是賦值的話用case when 字段= (case when 條件1 then  值1
                when 條件2  then  值2
                 .......
                 else  預設值 end)
      

  2.   

    掉了个when 
    应该是case  when a>b then .. else ...end 
      

  3.   

    SQL还是有它自己的特点的。楼主的要求可以通过CASE WHEN 来解决。
    IF 
    BEGIN
    END也OK的。 
      

  4.   

    if
    begin
    ..
    end
    else
    begin
    ...
    end
      

  5.   

    if ... else  和 case when then ... else end 都可以实现