Reputation: 48475
I have a column in a table which needs to be replaced with a column from another table. Basically one is the short description of items and the other (that was found in another table) is the long descriptions of the same items in the same order.
I'm pretty new to actually writing queries with mysql, (i've always relied on ActiveRecord or the like), so please don't newbie bash me on that.
What would this query look like?
Upvotes: 2
Views: 1797
Reputation: 22340
UPDATE
FirstTable
JOIN SecondTable ON FirstTable.ItemID = SecondTable.ItemID
SET
FirstTable.Description = SecondTable.LongerDescription
Upvotes: 7