删除重复的记录,并保存第一条记录或保存最后一条记录
程序员文章站
2022-04-16 09:46:56
删除表:dgpage中mail重复的记录并保留最后一条. delete dgpage where id in ...
删除表:dgpage中mail重复的记录并保留最后一条.
delete dgpage where id in ( select a.id from dgpage a, dgpage b where a.mail = b.mail and a.id > b.id )
删除表:dgpage中mail重复的记录并保留最近一条.
delete dgpage where id in ( select a.id from dgpage a, dgpage b where a.mail = b.mail and a.id <b.id )
delete dgpage where id in ( select a.id from dgpage a, dgpage b where a.mail = b.mail and a.id > b.id )
删除表:dgpage中mail重复的记录并保留最近一条.
delete dgpage where id in ( select a.id from dgpage a, dgpage b where a.mail = b.mail and a.id <b.id )
下一篇: oracle存储过程常用的技巧(详)