Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 table1 (col1,col2) 和 table2(col1,col2) 如下/
现在我需要用 table2 中 col1 和 col2 的相应值替换 table1 的 col2 值。所以决赛桌应该是这样的。我们如何在查询中做到这一点?
我假设 table1.col2 和 table2.col2 具有相同的文本类型(?)
update table1 set table1.col2=table2.col2 from table1 join table2 on (table1.col2=table2.col1)