row_number() over(order by b.FInterID,b.FEntryID) as Fid ROW_NUMBER() over(PARTITION by z.Fid order by z.Fid,z.FRow desc) id,