select b.* from (select a.*,row_number() over (partition by 列1 order by 列2 desc) rn from a) b ; --如需联表 select e.Customer,a.SAPModel,a.PackNo,a.Quantity,a.Bin,a.LastUpdated as StockInTime,a.High,a.Width,a.Length, a.Weight, a.Batch, case when a.PackedT