gpt4 book ai didi

SQL错误,我不明白

转载 作者:行者123 更新时间:2023-11-29 01:25:04 27 4
gpt4 key购买 nike

INSERT INTO `tims`.`pending_profile`(`id`, `nickname`, `location`, `role`, `yog`, `interests`, `favMoment`, `gainThisYr`, `futurePlans`, `bio`) 
VALUES ('1', '1', '1', '1', '', '1', '1', '1', '1', '1')
ON DUPLICATE KEY UPDATE ( nickname ='1', location= '1', role= '1',yog= '1',interests= '1',favMoment= '1',gainThisYr= '1',futurePlans= '1',bio= '1')

是什么触发了这个错误?

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '( nickname ='1', location= '1', role= '1',yog= '1',interests= '1',favMoment= '1'' at line 3

最佳答案

在字段之间放置逗号:

INSERT INTO tims.pending_profile
(id, nickname, location, role, yog, interests, favMoment, gainThisYr, futurePlans, bio)
VALUES
('', '1', '1', '1', '', '1', '1', '1', '1', '1')
ON DUPLICATE KEY UPDATE nickname ='1', location= '1', role= '1', yog= '1', interests= '1', favMoment= '1', gainThisYr= '1', futurePlans= '1', bio= '1'

关于SQL错误,我不明白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3560379/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com