Write a query to find second highest salary of an employee.
Answers were Sorted based on User's Feedback
Answer / ravi
I write this query and it run !!
SELECT max(salary) FROM Employee WHERE Employee.salary <
(SELECT max(salary) FROM Employee)
Plz reply if anyone having generic answer. :-)
Thanks
| Is This Answer Correct ? | 313 Yes | 56 No |
Answer / pradeep kumar
Select max(salary) from emp where salary NOT IN (Select max
(salary) from emp)
| Is This Answer Correct ? | 95 Yes | 16 No |
Answer / vittal
select max(sal)from emp e1 where 2<=(select count(*) from
emp e2 where e1.sal <= e2.sal);
| Is This Answer Correct ? | 66 Yes | 38 No |
Answer / upali tejale
Select max(salary) from employee where salary NOT IN
(Select max(salary) from employee)
| Is This Answer Correct ? | 13 Yes | 1 No |
Answer / priyanshu
select First_Name,Salary from employees where salary in
( select max(salary) from employees
where salary < ( select max(salary) from employees) ),
| Is This Answer Correct ? | 11 Yes | 0 No |
Answer / sweety spear
select *from emp e1 where &n =(select count(*) from emp
where sal >= e1.sal);
| Is This Answer Correct ? | 13 Yes | 3 No |
Answer / lokesh kanithi
Select * from emp e where 2=(select count(Distinct(esal))
from emp where e.esal<=emp.esal)
| Is This Answer Correct ? | 27 Yes | 22 No |
Answer / rajkumar mandala
select sal from
(select rank() OVER (order by sal desc) sno ,sal from emp)
y
where sno= n
here
y : is the alias name for (select rank() OVER (order by sal
desc) sno ,sal from emp)
n : is the number ie if u want second highest sal then 'n'
value will be 2. for third highest n= 3...
| Is This Answer Correct ? | 7 Yes | 2 No |
Any kind of test which you think should not be automated?
Hi friends please tell me regardinr to QTP descriptive programming. if any materials are there suggest me. or if you have please give me. thank u waiting for reply
Hi, I wanted to go with TestingDomain-Automation. Regarding this I need to take training on any one tool either WinRunner or LoadRunner. Which is better to get job,having future and takes lesstime with easier***. pls mention one tool name. Basically iam manual test engineer on unix- platform.
what r the diffence between QTP 8.2 & QTP9.0?
Explain Bug Life Cycle and expalin briefly each 'Status' also
How could the web element attributes be inspected in order to use them in different locators?
What are the application does winrunner support? What are the applicaiotn does QTP support? Does winrunner, QTP can be used in Linux OS?
What criteria do you consider for automating a test?
Does every software project need testers?
What is the major difference between Functional test, Acceptance test, Usability test and performance test. With special reference to automotive domain
what is the difference between keyword driven frame work and data driven frame work.
Elaborate the situation where automation testing can’t be used for agile methods?