HomeBlogGroup by Max not desired results in SQL ?Problem and SolutionsGroup by Max not desired results in SQL ?By M.K. Verma · 4 May 2022The last by PK row for a ContactId using top with ties SELECT top(1) with ties * FROM Contacts ORDER BY row_number() over(partition by ContactID order by PK desc)Share this:CommentsLeave a commentPost