gpt4 book ai didi

mysql - mysql查询后出了什么问题?

转载 作者:行者123 更新时间:2023-11-29 00:03:48 24 4
gpt4 key购买 nike

INSERT INTO lm_empleavetypemodelmap(leavetypeid,userid)
VALUES(1682,"b0c6c81f-a20a-4daa-9038-831478d8e11b")
WHERE lm_empleavetypemodelmap.userid NOT IN
(SELECT lm_empleavetypemodelmap.userid
FROM lm_empleavetypemodelmap
WHERE lm_empleavetypemodelmap.leavetypeid = 1683)

[Err] 1064 - 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 'WHERE lm_empleavetypemodelmap.userid NOT IN( select lm_empleavetypemodelmap.user' at line 1

最佳答案

您不要将 wherevalues 一起使用。也许最后的东西只是偶然的垃圾,你只是想要:

INSERT INTO lm_empleavetypemodelmap(leavetypeid, userid)
SELECT 1682, 'b0c6c81f-a20a-4daa-9038-831478d8e11b';

或者,在我看来很奇怪的地方:

INSERT INTO lm_empleavetypemodelmap(leavetypeid, userid)
SELECT 1682, 'b0c6c81f-a20a-4daa-9038-831478d8e11b'
WHERE NOT EXISTS (SELECT 1 FROM lm_empleavetypemodelmap WHERE leavetypeid = 1683)

即插入1682,如果1683不存在。通常您关心的是插入的值,而不是下一个值。

关于mysql - mysql查询后出了什么问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28455160/

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