Reputation: 11363
Given two fields in a table, how can I use the results of a CONCAT
query to populate the results of a third column in the same table?
SELECT CONCAT (`field`, '-', `field2`) from `bgt_table`
prints out the correct format, but how can I insert the results in the appropriate row?
Upvotes: 1
Views: 23
Reputation: 263803
you need UPDATE
UPDATE bgt_table
SET thirdColumn = CONCAT (`field`, '-', `field2`)
Upvotes: 2