0
在一個單一的入口,我們可以使用ON DUPLICATE KEY
來UPDATE
值:如何使用ON DUPLICATE KEY進行多項輸入?
INSERT INTO table
(title, number) VALUES ('$title', '$amount')
ON DUPLICATE KEY UPDATE number=number+$amount
如何使用`ON多次入境重複鍵爲
INSERT INTO table
(title, number) VALUES
('$title1', '$amount1'),
('$title2', '$amount2'),
('$title3', '$amount3')
.....
如何將'$ amount1','$ amount2','$ amount3' ....(數值從PHP中提取)添加到列的當前值? – Googlebot
@Ali:對不起,我沒有做PHP,爲什麼不嘗試像'number = number + values(number)' –
就是這樣!怎麼會這麼盲目,看不到這個!感謝您的澄清。 – Googlebot