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 date and time functions in mysql? : Sql dba
what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba
explain the difference between bool, tinyint and bit. : Sql dba
What does t sql mean?
What jobs use sql?
Does view store data in sql?
Explain the difference between rename and alias?
What is a primary key? Explain
what is the command line end user interface - mysql? : Sql dba
Is sql easier than java?
What is a pdo connection?
Determine if oracle date is on a weekend?
How to change a value of the field ‘salary’ as 7500 for an employee_name ‘john’ in a table employee_details?
Enlist the characteristics of pl/sql?
What is auto increment?