This answer comes close to what I need but my situation is slightly different. I have a SQL table look like this.
+------+----------+-----------+
| aid | afname | alname |
+------+----------+-----------+
| 01 | John | Doe |
| 02 | Stephen | Williams |
| 03 | Jane | Doe |
| 04 | Peter | Brown |
| 05 | | |
+------+----------+-----------+
Now I need to clone/copy only the afname
and alname
fields from the row which has the 02 aid
and insert it into the row with the aid
05.
This is the query I tried but it throws an Syntax error.
INSERT INTO table1(afname, alname)
WHERE aid = '05'
SELECT afname, alname
FROM table1
WHERE aid = '02'
Can anyone please tell me a way to accomplish this?
Many thanks.