sql server如何删除由多个字段判断的重复字段

sql server如何删除由多个字段判断的重复字段
列名分别为year month day time velocity 前四项数据类型我设置的是int 其实前面还有几项是decimal velocity的类型也是decimal 我查找出来相同项发现是前面四项都一样的情况下,velocity有两个不同的值,我需要保留小的那个或者第一个
-delete from table where exists ( select 1 from table t1 where t1.year = table.year and t1.month = table.month and t1.day = table.day and t1.time = table.time and t1.velocity > table.velocity)
← 上一篇: 下一篇: →