使用连接查询更新表 [英] update table using join query
问题描述
我有两张桌子,两张桌子都有id作为公共区域。
ID NAME
---------------------- ----------
1
2
2
ID LNAME
---- ------------------ ----------
1 a
2 a
2 b
请告诉我,如何使用第二个表中的lname更新第一个表中的名称。
请帮助
Hi,
I have two tables, both are having id as a common field.
ID NAME
---------------------- ----------
1
2
2
ID LNAME
---------------------- ----------
1 a
2 a
2 b
Please tell me, how to update the name in first table with lname in second table.
Please help
推荐答案
尝试更新firsttable set Name = LName from firsttable firsttable上的内连接第二表.id = secondtable.id
这篇关于使用连接查询更新表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!