TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mohsin Arif
313
6k
137.2k
Get difference of salary row by row ?
Apr 10 2020 7:48 AM
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
Reply
Answers (
1
)
Insert into from one to another table with different value
select value from row-1 MS SQL from multiple table