gpt4 book ai didi

php - SQL 语法错误 SELECT

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

我对 MySQL 很陌生,我正在尝试解决查询问题。我正在运行一项 cron 作业,该作业从一个数据库更新另一个数据库,但出现以下错误:

#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 'and a.entity_id not in (select magento_order_id from mg_asul' at line 4

这是我尝试执行的查询:

select entity_id 
from mg_sales_flat_order a
where status = 'complete'
and a.entity_id >
and a.entity_id not in
(select magento_order_id
from mg_asulpunto_unicentaopos_order_item b
where b.magento_order_id=a.entity_id)

据我所知,这似乎是 mysql 中的表名和受限变量的问题,但到目前为止我还无法引用正确的表名。任何帮助将不胜感激。

最佳答案

您在 和 a.entity_id > 之后遗漏了一些内容

select entity_id 
from mg_sales_flat_order a
where status = 'complete'
and a.entity_id > /* Specify the value after > sign */
and a.entity_id not in
(select magento_order_id
from mg_asulpunto_unicentaopos_order_item b
where b.magento_order_id=a.entity_id)

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

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