update t1 set nol=case shu when  1 then 'value1' when 2 then 'value2' end

解决方案 »

  1.   

    update t1
    set no1=( case shu
                  when 1 then 值1
                  when 2 then 值2
                  when 3 then 值3
                  when 4 then 值4
                  when 5 then 值5
              end
            )
      

  2.   

    sql = "update t1 set no1=( case shu when 1 then 值1 when 2 then 值2 when 3 then 值3 when 4 then 值4 when 5 then 值5 end ) " 我这样横着写不对了?  因为我要在程序中执行我在conn.execute sql 就不对了
      

  3.   

    try  :sql = "update t1 set no1=( case shu when 1 then 值1 when 2 then 值2 when 3 then 值3 when 4 then 值4 else 5  end ) "
    而且  尽量写在一行