关于mysql delete的问题小结
时间:2024-01-17 09:28:39
由于mysql数据库的相关内部问题
导致delete from table where col not in (select col from table group by xx)
会提示报错
我们要做的是
create table tmp selete col from table group by xx;
delete from table where col not in (select col from tmp);
drop table tmp;
今天,在开发自己的项目中需要把项目原来的数据导入到新的系统中,在这个过程中会产生部分脏数据。
我们需要把这部分脏数据删除到,在删除的过程中我写的delete sql语句不能执行不知道为什么,可以同样的语句执行
select 是没有问题的
如:
delete from student a where a.id in (1,2);()
select a.* from student a where a.id in (1,2);()
这是什么原因了呢?
结果处理:
delete 在写操作一张表的时候 不用别名操作成功!
如:
delete from student where id in (1,2);()
我使用mysql版本:5.1.30-community-log
这是在开发中遇到的一个小问题,积累起来。
标签:mysql,delete
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
用来武装Firefox的24款Web开发插件
2010-02-28 12:40:00
Python实现扫描局域网活动ip(扫描在线电脑)
2022-10-02 02:38:52
基于python读取.mat文件并取出信息
2021-10-24 12:06:26
![](https://img.aspxhome.com/file/2023/1/75971_0s.png)
Python访问MongoDB,并且转换成Dataframe的方法
2022-07-18 20:32:07
Tensorflow的常用矩阵生成方式
2023-03-27 16:03:55
python中return如何写
2023-11-17 21:44:56
解决Python3 控制台输出InsecureRequestWarning问题
2021-08-04 21:17:57
详解MySQL 慢查询
2024-01-26 19:00:58
![](https://img.aspxhome.com/file/2023/9/85809_0s.png)
整理Python 常用string函数(收藏)
2021-08-25 19:21:52
Python rindex()方法案例详解
2022-04-18 07:06:44
Oracle11.2.0.1如何升级到11.2.0.3 Oracle同版本升级
2023-06-25 15:28:11
Python聊天室带界面实现的示例代码(tkinter,Mysql,Treading,socket)
2024-01-23 21:46:07
![](https://img.aspxhome.com/file/2023/5/114595_0s.gif)
Python元组拆包和具名元组解析实例详解
2021-10-17 05:26:58
Linux下安装MySQL教程
2024-01-19 08:05:18
![](https://img.aspxhome.com/file/2023/8/121278_0s.png)
php上传图片到指定位置路径保存到数据库的具体实现
2024-05-09 14:48:22
perl命令行参数内建数组@ARGV浅析
2022-11-04 06:58:47
学习JavaScript设计模式之装饰者模式
2023-07-19 08:59:07
PHP对战ASP:这还值得讨论吗
2008-04-16 14:19:00
python实现双人版坦克大战游戏
2022-08-30 06:52:57
![](https://img.aspxhome.com/file/2023/0/133540_0s.jpg)
python中类变量与成员变量的使用注意点总结
2022-01-08 03:39:51