Write a query to find second highest salary of an employee.
Answer Posted / ashish
select salary from
(select dense_rank() over(order by salary desc) as highest, salary from employee)as y
where highest=2
: replace 2 with n.... it will give nth highest salary
: rank() will work correctly only if all the salaries in employee table are distinct.
: dense_rank() will work correctly, does'nt matter salaries are distinct or NOT.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
We have a testing assignment that is time-driven. Do you think automated tests are the best solution?
Tell us what you know about table-driven testing?
What are the most popular tools for automation testing?
What is data - driven automation?
Can any one give me the script for drag and drop or setselection functions ?like in a not pad i want to select 5 lines
What is a ‘test plan’? What is a ‘test case’?
Explain me what is a framework and what are the frameworks available in rc?
What is vendor tool and give examples?
Which protocol cam be used to makw jdbc connection woth loadrunner
How can we make one test method dependent on other using testng?
How can you switch back from a frame?
if i want to use different values in datatable with each iteration of for loop what would i do ??/
What is test automation or automation testing?
How can you create html test report from your test script?
HOW DO YOU PERFORM SECURITY TESTING TO VERIFY FIREWALLS,PASWORD ENCRYPTOPNS ETC?