MYSQL delete语句不支持别名的问题_MySQL
程序员文章站
2022-06-06 22:40:06
...
bitsCN.com
有一个表的数据比较大,然后需要进行关联删除,删除的时候发现如下SQL报错: DELETE FROM test.test1 a WHERE EXISTS (SELECT 1 FROM test.test2 b WHERE a.recordID=b.smsInfoID AND b.receiveTime 报错如下: Error Code: 1064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a WHERE EXISTS (SELECT 1 FROM test.test2 b WHERE a.recordID=b.smsInf' at line 1 开始以为是exists的问题,于是更改成in再测试,也报同样错: DELETE FROM test.test1 a WHERE a.recordid IN (SELECT b.smsInfoID FROM test.test2 b WHERE b.receiveTime
有一个表的数据比较大,然后需要进行关联删除,删除的时候发现如下SQL报错: DELETE FROM test.test1 a WHERE EXISTS (SELECT 1 FROM test.test2 b WHERE a.recordID=b.smsInfoID AND b.receiveTime 报错如下: Error Code: 1064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a WHERE EXISTS (SELECT 1 FROM test.test2 b WHERE a.recordID=b.smsInf' at line 1 开始以为是exists的问题,于是更改成in再测试,也报同样错: DELETE FROM test.test1 a WHERE a.recordid IN (SELECT b.smsInfoID FROM test.test2 b WHERE b.receiveTime
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
推荐阅读
-
Python中LOADDATAINFILE语句导入数据到MySQL遇到问题的解决方案分享
-
完美解决mysql in条件语句只读取一条信息问题的2种方案
-
解决Node.js mysql客户端不支持认证协议引发的问题
-
Mysql使用kill命令解决死锁问题(杀死某条正在执行的sql语句)
-
从MYSQL的binlog恢复指定的SQL语句,解决中文乱码问题。
-
解决python mysql insert语句的问题
-
MySQL两种删除用户语句的区别(delete user和drop user)
-
基于mysql中delete的语法别名问题
-
分析Mysql表读写、索引等操作的sql语句效率优化问题
-
MySQL数据库INSERT、UPDATE、DELETE以及REPLACE语句的用法详解_MySQL