+ -
当前位置:首页 → 问答吧 → 新手求教:如何删除部分重复数据

新手求教:如何删除部分重复数据

时间:2011-06-03

来源:互联网

如附件(由Find Duplicate Query所得)所示,图中高亮部分有12条记录,如果按照FirstofInspection可以分成三组,我只想要其中一组,请教如何删除其余两组我不需要的数据!多谢指教!

[ 本帖最后由 yorkxian 于 2011-6-3 02:21 编辑 ]

附件

duplicate.gif(9.12 KB)

2011-6-3 02:19

作者: yorkxian   发布时间: 2011-06-03

delete from (select * from tb a where exists(select 1 from tb where Material=a.Material and FirstofInspection>a.FirstofInspection))

作者: marco   发布时间: 2011-06-03