how to calcuate the second highest salary of he employee
Answer Posted / jitendra
To get nth highest Salary, use below query
SELECT TOP 1 salary
FROM (
SELECT TOP nth salary
FROM Emp
ORDER BY salary DESC
) TmpTable
ORDER BY salary ASC
Replace nth with your number like second highest=2 4th=4 etc
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
what are string data types? : Sql dba
Is merge a dml statement?
What is date functions?
What is lookup table in sql?
What is sql*plus?
Which table is left in left join?
how to use like conditions? : Sql dba
Can we insert in sql function?
What is the starting oracle error number?
What is data type in sql?
What is a unique constraint?
How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?
how can we know the number of days between two given dates using mysql? : Sql dba
Is sql procedural language?
What is the difference between between and in condition operators?