0
我的問題是我有一個更新的重複鍵查詢插入,它是像下面這樣:對重複密鑰更新 - 幫助需要
INSERT INTO TABLE
(COL1, COL2, COL3 , ETC...)
SELECT
COLA1, COLA2, COUNT(1) , ETC...
FROM TABLE2
WHERE 'CONDITION'
GROUP BY COL1, COL2, COL3
ON DUPLICATE KEY UPDATE COL1=VALUES(COLA1), COL3=COUNT(1)
該查詢返回一個錯誤:常規錯誤:1111無效使用組功能SQL
COL1, COD2, COL3 ARE COMPLEX KEY.
謝謝你的這個answear。這是正確的。還有在這篇文章中陳述的另一種方法:http://stackoverflow.com/questions/16935896/mysql-on-duplicate-key-update-while-inserting-a-result-set-from-a-query – BrokenPixel