I have the following table which I’ll call ‘example’
id name last_name
01 Adam Adams
02 Bill Billo
03 Cathy McCathyson
I need to modify the table and end up with the following:
id name
01 Adam Adams
02 Bill Billo
03 Cathy McCathyson
For a single row, I know how to write this query:
UPDATE example SET name =
(SELECT name FROM example WHERE id = 01)+" "
+(SELECT last_name FROM example WHERE id = 01)
WHERE id = 01;
How do I modify this query such that it updates each row with that row’s values, as in the example?
EDIT: I’ve updated my example since it confused the issue.
1 Answer