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
Why is sql important?
Which kind of parameters cannot have a default value in pl sql?
What is relationship? How many types of relationship are there?
What are the uses of merge?
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?
What is function and procedure in pl sql?
Explain about various levels of constraint.
how to write date and time literals? : Sql dba
Suppose a student column has two columns, name and marks. How to get name and marks of the top three students.
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..
What is %rowtype in pl sql?
How to test for null values?
How to order siblings in oracle hierarchy queries?
Can you select everything, but 1 or 2 fields, without writer's cramp?
How do I count rows in sql query?