码迷,mamicode.com
首页 > 其他好文 > 详细

delete from 加上 select 的处理方式

时间:2015-08-29 12:50:40      阅读:1011      评论:0      收藏:0      [点我收藏+]

标签:

create table tmp as select id as col1 from `temp_price` WHERE id = 52 group by id,marketid,date_format(date,‘%Y%m%d‘);

delete from  where  temp_price id = 52 and id  not in (select col1 from tmp); 

drop table tmp;

该方法主要建立一个临时表存储select信息。这样就避免了delete  和select的异常错误。

delete from 加上 select 的处理方式

标签:

原文地址:http://my.oschina.net/u/1384818/blog/498936

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!