SQL审核判定字段不存在
1.2206
UPDATE report_info m, ( SELECT m.merchant_no,m.pay_day,s.effective_time, DATEDIFF(m.pay_day,s.effective_time) AS days FROM report_info m LEFT JOIN merchant_info s ON m.merchant_no=s.merchant_no ) b SET profit_type='00' WHERE m.merchant_no=b.merchant_no
error 字段 b.merchant_no 不存在 warn delete/update 语句必须有limit条件 notice 暂不支持回滚多表的 DML 语句
建议这种子查询的忽略字段的检查
你能提供merchant_info,report_info这两张表的DDL信息吗?
修改后的效果

发现 delete 语句也存在类似的问题
DELETE t1, t2
FROM t1
INNER JOIN t2
INNER JOIN (SELECT m.merchant_no
FROM report_info m,
merchant_info s
where m.merchant_no = s.merchant_no) b
WHERE t1.id = t2.id
AND t2.id = b.merchant_no;

修改后的效果

你能提供
merchant_info,report_info这两张表的DDL信息吗?
根据sql反推的建表DDL信息
create table t1
(
id int primary key not null
);
create table t2
(
id int primary key not null
);
create table report_info
(
merchant_no int primary key not null,
profit_type varchar(20) not null,
pay_day datetime not null
);
create table merchant_info
(
merchant_no int primary key not null,
effective_time datetime not null
);
UI Version: release-1.2207.x 92b44b8 Server Version: release-1.2207.x-ee 018349a02a 复现步骤: 1.根据上述表结构创建好mysql表 2.然后根据上述的UPDATE语句去审核,然后出现字段不存在的报错

验证版本: UI Version: main b4bfb8d Server Version: main-ee 3c255f3b01 验证步骤: 1.根据上述表结构创建好mysql表 2.然后根据上述的UPDATE何delete语句去审核,未出现字段不存在的报错
