set 后面字段不用带表别名 否则会报错
update hqweb.t_car t
set county_code = map.county_code
from hqmap.t_car_pos map
where t.terminal_id = map.terminal_id
本文介绍了一种在SQL中更新记录的技巧,特别是在使用表连接时如何避免因使用表别名而导致的错误。通过示例解释了正确的字段引用方式。
set 后面字段不用带表别名 否则会报错
update hqweb.t_car t
set county_code = map.county_code
from hqmap.t_car_pos map
where t.terminal_id = map.terminal_id
1596
2412
2488
916

被折叠的 条评论
为什么被折叠?