INSERT INTO `Users`
(ID,FirstName,LastName)
VALUE
('60','Alex','Mathew')
ON DUPLICATE KEY
UPDATE
FirstName = 'Alex' AND LastName = 'Mathew'
ID - is the Unique key
插入有效,但将FirstName
更新为' 0'。错误在哪里?
答案 0 :(得分:3)
测试它:
INSERT INTO `Users`
(ID,FirstName,LastName)
VALUE
('60','Alex','Mathew')
ON DUPLICATE KEY
UPDATE
FirstName = 'Alex', LastName = 'Mathew'
在','
上更改AND