Click here to Skip to main content
15,067,539 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Posted
Updated 8-Feb-13 19:14pm
v2

1 solution

Try Update firsttable set Name = LName from firsttable inner join secondtable on firsttable.id = secondtable.id
   
v2
Comments
ramukirs 9-Feb-13 2:14am
   
Error showing, column qualifier or second table is undefined
Abhinav S 9-Feb-13 12:01pm
   
Try again. I modified my answer slightly.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900