Home > Back-end >  SQL update from one Table to another based on a Column
SQL update from one Table to another based on a Column

Time:11-30

I have two tables called ata and sku and i want to match SKU from ata table and ARTIKEL_NUMBER from sku table to fit weight from ATA (TOTAL_WEIGHT_PIECE) on sku column called Greutate_kg.

enter image description here (ATA TABLE) enter image description here (SKU TABLE) enter image description here

CodePudding user response:

You can try next:

UPDATE sku
JOIN ata ON ata.ARTIKEL_NUMBER = sku.SKU
SET sku.Greutate_kg = ata. TOTAL_WEIGHT_PIECE
WHERE sku.Greutate_kg IS NULL;
  • Related