select * From (Select fs.id ,fs.other ,ROW_NUMBER() Over (Partition by fs.id --指定记录的ID order by fs.updatetime DESC --时间优先级 ) Fsp From Storage AS fs ) AS Storage Where Fsp = 1
【SQL Server】实现有多条记录ID相同,取时间最近的一条

select * From (Select fs.id ,fs.other ,ROW_NUMBER() Over (Partition by fs.id --指定记录的ID order by fs.updatetime DESC --时间优先级 ) Fsp From Storage AS fs ) AS Storage Where Fsp = 1