根据表中facctparent字段的不同值,对应赋予 c_km_code 字段不同的值,then语句后面即是c_km_code的值,以end结尾。
update md_km_map
set c_km_code = case
when facctparent = '19040101' then
'1901.01.01.<SEC>'
when facctparent = '19040199' then
'1901.01.99.<SEC>'
when facctparent = '19040201' then
'1901.02.01.<SEC>'
when facctparent = '19040299' then
'1901.02.99.<SEC>'
when facctparent = '19040401' then
'1901.04.01.<SEC>'
when facctparent = '19040499' then
'1901.04.99.<SEC>'
end
where fjjdm = '512290'
and fyear = '2020'