Fetch Highest second Record In SQL Server.
Introduction : In this article i will show you how to fetch second highest salary record in sql server database .Here you can fetch entire second highest row from the table in sql server .To achieve the highest record i have used Row_number().
Example : Following is example which fetch second highest salary record from the table in sql server .
Introduction : In this article i will show you how to fetch second highest salary record in sql server database .Here you can fetch entire second highest row from the table in sql server .To achieve the highest record i have used Row_number().
Example : Following is example which fetch second highest salary record from the table in sql server .
Select * from ( select Row_number() over ( order by salary desc ) as Row_INDEX , * From Data ) as Temp where Row_INDEX = 2
No comments:
Post a Comment