1

Scenario : Table1 and Table2 has same columns =>Table1 has All data =>Table2 has updated values except "ProductCode"(this one column remain same)

I just want to match productcode from both table and need to update in Table1

table look like this

please help me out

Baba Ranjith
  • 196
  • 14
  • 2
    Does this answer your question? [SQL Update from One Table to Another Based on a ID Match](https://stackoverflow.com/questions/224732/sql-update-from-one-table-to-another-based-on-a-id-match) – pringi Jul 06 '22 at 07:38

1 Answers1

1

You can do it by this -

Update `Table1` 
  INNER JOIN `Table2` ON (Table1.ProductCode = Table2.ProductCode)
  SET Table1.Category = Table2.Category
  ....

You need to give all fields to be updated.

Manik
  • 264
  • 2
  • 8