Write a query to find second highest salary of an employee.

Answer Posted / versaites

select top 1 emp_total_sal,emp_name from (
select top 2 emp_total_sal,emp_name from employee_table
ORDER BY emp_total_sal DESC) a
ORDER BY emp_total_sal ASC

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is sql important?

575


Which kind of parameters cannot have a default value in pl sql?

587


What is relationship? How many types of relationship are there?

584


What are the uses of merge?

715


How we can create a table in pl/sql block. Insert records into it? Is it possible by some procedure or function? Please give example?

587






What is function and procedure in pl sql?

515


Explain about various levels of constraint.

517


how to write date and time literals? : Sql dba

522


Suppose a student column has two columns, name and marks. How to get name and marks of the top three students.

519


ERROR:Insert or update on table"accnt" violates foreign key constraints "acct_to_curr_symbol" DETAILS:KEY(accnt_curr_id)(-2)is not present in the table "curr_symbol" ......solve The Problem..

2000


What is %rowtype in pl sql?

509


How to test for null values?

598


How to order siblings in oracle hierarchy queries?

593


Can you select everything, but 1 or 2 fields, without writer's cramp?

492


How do I count rows in sql query?

485