SQL删除重复的数据,只保留一条

delete from 表名 where id not in( select min([id]) from 表名 group by [重复字段])

例:

delete from Sell_cardinfo where id not in( select min([id]) from Sell_cardinfo group by [nullah_num])

posted @ 2011-12-08 16:43  戴眼镜的乌龟  阅读(122)  评论(0)    收藏  举报