首页 > 其他 > 详细

delete from 加上 select 的处理方式

时间:2015-08-29 12:48:28      阅读:258      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!