当(HostCd)列的姓与字符串的最后一个单词匹配时,我想更新列(HostActvTyp和HostPrvTyp) 主机列“ NXVR”的示例字符串,“ REACTIVE”,因此最后一个单词是R,因此当N'为“ NEW”时我们必须更新为Reactive示例“ XVDN” enter image description here
答案 0 :(得分:0)
似乎正在寻找left或substr()
update tablename
set ActTyp = 'INDEPENDENT'
where ActvTyp = left(your_value,1 )
答案 1 :(得分:0)
https://www.db-fiddle.com/f/bG4jZfnWksjc315eGTuG2k/1
div:not(.dark-mode) .main-inner{ background: rgba(252, 252, 252, 0) !important; }
或者如果有空格分隔符
UPDATE tablename
SET ActTyp = 'INDEPENDENT'
WHERE 'I' = RIGHT(ActvTyp, 1)