mysql> UPDATE tblitem SET imagefilename = (SELECT imagefilename from tblitem where itemid=2) where itemid=1'
1093 - You can't specify target table 'tblitem' for update in from clause
UPDATE tblitem t JOIN (SELECT imagefilename from tblitem where itemid = 2 ) t2 SET t.imagefilename = t2.imagefilename WHERE itemid = 1;
The SQL standard and other databases allow you to refer to the table being updated elsewhere in the
update statement. However, MySQL does not allow this. The
JOIN is a simple enough work-around.