I am trying to update a table value from another table. I want to update pstatus from productcode.
Here is my code (which gives no error and results 0 rows):
UPDATE pstatus
SET code=(select code FROM productcode)
besides this, I can’t re-run any update in sql – it gives no error, but returns 0 rows (I have more than 5 rows in productcode table).
In this case you have a two problem
you say you dont have any rows in pstatus if no record in table how can table row update ?
your inner query
select code FROM productcodereturn more then one row then how sql decide to set with value in wich field?