You asked:
Quote:
I need to insert the table2 to table 1
That should be an "update" operation since all the code's in table2 exist in table1.
update table1 set img=(select img from table2 where table1.code=code)
where exists (select * from table2 where table1.code=code);
select * from table1