hellow guys i have some data in tables like this
Data in our table:
EmpName Salary
Row 1. EmpName1, 10000
Row 2. EmpName2, 20000
Row 3. EmpName3, 12000
i want to get highest salary and minus 2nd highest and show diifrence like this
Empname Salary Diifrence
Row 1. EmpName2, 20000, 8000
Row 2. EmpName3, 12000, 2000
Row 3. EmpName1, 10000, NULL
how can i get this in sql server please some one to help me
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Jignesh KumarPosted Apr 10, 2020, 9:11 AM