Write a query to find second highest salary of an employee.
Answers were Sorted based on User's Feedback
Answer / aj.com
SELECT MAX(SALARY) FROM EMPLOYEE WHERE SALARY NOT IN (SELECT
MAX(SALARY) FROM EMPLOYEE)
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / shyam
select max(salary) as '2nd Highest Salary'
from Employee a
where 2<=(select count(*) from Currencies b where a.salary
<= b.salary);
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / nilesh chaudhari
Select max(Salary) as 'Second Highest Salary' from Employee
where USdollar NOT IN
(Select max(Salary) from Employee)
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / saravanan.s
select max(salary) as salaryemp from employee where
employee.salary<(select max(salary) from employee)
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / rajesh kole
SELECT MIN(Sal) FROM Employee
WHERE Sal IN
(SELECT TOP 4 Sal FROM employee ORDER BY Sal DESC)
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sup
SELECT TOP 1 salaryamount
FROM (
SELECT DISTINCT TOP 3 salaryamount
FROM mstsalary
ORDER BY salaryamount DESC) a
ORDER BY salaryamount
--sup--
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / hardit
select TOP 1[salary]
from(
select distinct TOP 2[salary]
from empTable
order by salary desc
) a
order by salary
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / kedo
select sal from
select * from employee orderby salary DESC
Limit 1,1
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / harikrishna ravipati
select max(sal) from emp where sal <
(select max(sal) from emp)
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / chandramami
SELECT MAX(e.salary)
FROM emp e,emp e1
WHERE e.salary<e1.salary;
| Is This Answer Correct ? | 0 Yes | 0 No |
how is mind q venkat training in testing for weekend or general batches.and any other good institutes in ameerpet
How to Rcognize the Objects in the Web Page Dialog Using QTP
How do you select which automation tool is best suited for you?
what r the diffence between QTP 8.2 & QTP9.0?
What is hybrid automation?
What criteria do you consider for automating a test?
Explain me how do you send enter/tab keys in webdriver?
What is test driven development?
How can you switch back from a frame?
Can you explain me what is object repository?
Does Microsoft Corporation, Sun Microsystems possesing any maturity levels?if yes, what is that level?
What are the limitations of automating software testing?