关闭

去掉一个表的多个字段重复的记录

136人阅读 评论(0) 收藏 举报
分类:
delete from collect_order where (channel_id,op_date,currency) in ( select * from (select channel_id,op_date,currency from collect_order group by channel_id,op_date,currency HAVING count(*) > 1 ) t )
	and id not in (select * from (select id from collect_order group by channel_id,op_date,currency) v )



这里的 in 后面的 select * from 必须得有才行

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:23605次
    • 积分:471
    • 等级:
    • 排名:千里之外
    • 原创:9篇
    • 转载:86篇
    • 译文:0篇
    • 评论:1条
    文章分类
    最新评论