Problem I am working on some query for my project and the requirement is to show the second value. For sake of example, say I have salary table in Microsoft SQL Server and I need fetch the second maximum salary. I am not too experienced in T-SQL, I used the ... So I sow there is RANK() function in T-SQL, but I do not completely understand how it works. Any suggestions will very appreciated.