gpt4 book ai didi

mysql - 在表上运行更新时出现问题

转载 作者:行者123 更新时间:2023-11-29 07:50:22 25 4
gpt4 key购买 nike

我有以下查询:

   UPDATE p
SET p.isShown = 1
FROM `shop_picture` p
INNER JOIN `shop` s
ON p.shop_id = s.id
WHERE p.`isShown` = 0
AND p.`deletedAt` IS NULL
AND p.`isLocked` = 1
AND s.`isLocked` = 1
AND s.`expirydate` < '2014-10-28 00:00:00';

当尝试运行它时,我总是收到错误:

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 'FROM shop_picture` p INNER JOIN `shop` s O' at line 3

我不明白错误是什么。有人愿意提供线索吗?

最佳答案

UPDATE `shop_picture` p
INNER JOIN `shop` s
ON p.shop_id = s.id
SET p.isShown = 1
WHERE p.`isShown` = 0
AND p.`deletedAt` IS NULL
AND p.`isLocked` = 1
AND s.`isLocked` = 1
AND s.`expirydate` < '2014-10-28 00:00:00';

关于mysql - 在表上运行更新时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26601613/

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