简体   繁体   中英

SQL update from one Table to another based on a Column

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.

在此处输入图像描述 (ATA TABLE) 在此处输入图像描述 (SKU TABLE) 在此处输入图像描述

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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM