Help with update query
-
I have Table called Customers with CustomerId as Primay key, FirstName and LastName. I also have a table called CustomerUpdates. CustomerUpdates table has a foreign key of CustomerID. It also contains FirstName and LastName columns. How can I write a query to update the FirstName and LastName in Customers table with the FirstName and LastName in CustomerUpdates? Please help.
-
I have Table called Customers with CustomerId as Primay key, FirstName and LastName. I also have a table called CustomerUpdates. CustomerUpdates table has a foreign key of CustomerID. It also contains FirstName and LastName columns. How can I write a query to update the FirstName and LastName in Customers table with the FirstName and LastName in CustomerUpdates? Please help.
Hi i think, You must update one table at a time. You can update A while joining it with B to get the values you need. ie: UPDATE A SET A.myField = B.newField FROM A, B WHERE A.primaryKey = B.foreignKey Reply With Quote OR try some thing like this UPDATE CaveatsData SET CaveatsData.Title = CavTitle.Title FROM CavTitle, CaveatsData where CavTitle.RecId = CaveatsData.RecId
Prakash Mishra(Banglore,India)