gpt4 book ai didi

mysql - SQL 语法错误,语法无效

转载 作者:行者123 更新时间:2023-11-30 22:53:06 26 4
gpt4 key购买 nike

我有以下查询:

SELECT s0_.id, s0_.caption, s0_.lowresimageurl, s0_.medresimageurl, s0_.highresimageurl, s0_.price
FROM app_instagram_shop_picture s0_
LEFT JOIN app_instagram_shop s1_ force index (idx_locked_deletedAt)
LEFT JOIN app_instagram_picture_category s2_
LEFT JOIN app_instagram_first_level_category s3_
ON s0_.shop_id = s1_.id
AND s1_.deletedAt IS NULL
AND s0_.id = s2_.picture_id
AND s2_.first_level_category_id = s3_.id
WHERE (s0_.isShown = 1
AND s1_.id != 32179
AND s1_.expirydate IS NULL
AND s1_.deletedAt IS NULL
AND s1_.isLocked = 0
AND s1_.owner_id IS NULL
AND s0_.id != 2598561
AND s0_.deletedAt IS NULL
AND s0_.isStyleInspiration = 0
AND s0_.isLocked = 0
AND s3_.id = 11
)
AND (s0_.deletedAt IS NULL)
ORDER BY s0_.updated DESC
LIMIT 16

出于某种原因,这导致我出现以下错误:

SQLSTATE[42000]: Syntax error or access violation: 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 (s0_.isShown = 1
AND s1_.id != 32179
AND s1_.expirydate IS N' at line 10

但是,我似乎无法弄清楚问题是什么..

最佳答案

请记住每个 SELECT 语句只有一个 WHERE 子句,并在检查的最开始使用它,此后只使用 AND(我曾多次忘记这一点并在链中稍后放置额外的 WHERE 子句)

关于mysql - SQL 语法错误,语法无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27498402/

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