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 )
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 就不对了
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 ) " 而且 尽量写在一行
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
)
而且 尽量写在一行