INSERT INTO _fba_inventory (asin, store_id, total_qty)
VALUES (2, 2, 1)
ON CONFLICT (asin,store_id) DO UPDATE SET total_qty = 4,
write_date=now();
-- 發現沖突后什么也不處理
INSERT INTO _fba_inventory (asin, store_id, total_qty)
VALUES (2, 2, 1)
ON CONFLICT (asin,store_id) DO nothing ;
-- 將插入的值+5 用來更新
INSERT INTO starmerx_fba_inventory (asin, store_id, total_qty)
VALUES (2, 2, 1)
ON CONFLICT (asin,store_id) DO UPDATE SET total_qty = excluded.total_qty+4,
write_date=now();
-- 更新:在原有的基礎上+4
INSERT INTO _fba_inventory (asin, store_id, total_qty)
VALUES (2, 2, 1)
ON CONFLICT (asin,store_id) DO UPDATE SET _fba_inventory.total_qty = 4,
write_date=now();