我有以下用于7个状态的更新语句示例,什么是将所有内容合并到一个更新语句中的最佳方法。
update tt
set tax = 'il'
from tax_table tt
inner join name n on tt.id = n.id
where states = 'il'
update tt
set tax = 'md'
from tax_table tt
inner join name n on tt.id = n.id
where states = 'md'
谢谢
答案 0 :(得分:3)
update tt
set tax = states
from tax_table tt
inner join name n on tt.id = n.id
where states IN ('tt', 'md')