Write query to fetch second maximum salary from employee table.

Answers were Sorted based on User's Feedback



Write query to fetch second maximum salary from employee table...

Answer / ritesh

select max(salary) from emptable where salary < (select max(salary) from emptable);

Is This Answer Correct ?    8 Yes 0 No

Write query to fetch second maximum salary from employee table...

Answer / vijayalakshmi

select  top 1 Coumn_Name from (select top 2 Coumn_Name from Table_name order by Coumn_Name desc) b order by Coumn_Name

Is This Answer Correct ?    4 Yes 0 No

Write query to fetch second maximum salary from employee table...

Answer / abhishekjaiswal

select a.last_name,a.salary from employees a where 3=(select count(*) from employees b where b.salary>a.salary) order by a.salary desc.
<<<<<<<<<[N-1]>>>>>>>>>>

Is This Answer Correct ?    3 Yes 1 No

Write query to fetch second maximum salary from employee table...

Answer / santosh kumar

select * from(select rownum r,ename,sal from(select * from emp order by sal desc))where r=2;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

How to select the name of employee who is getting maximum sal with out using subquery

15 Answers  


How to convert dates to characters in oracle?

0 Answers  


Typically, where is the conventional directory structure chosen for Oracle binaries to reside?

0 Answers  


What is system tablespace?

0 Answers  


which is best insttute for teradata,sybase,mysql,oracle in hyderabad

1 Answers  






Can we write insert statement in function in oracle?

0 Answers  


What are the advantages of oracle 12c?

0 Answers  


From the following identify the non schema object: packages, triggers, public synonyms, tables and indexes.

0 Answers  


How many types of tables supported by oracle?

0 Answers  


17. Display the order number and average item cost for each order.

1 Answers   Wipro,


Explain self joins in oracle?

0 Answers  


What are cursor?where are they used?

2 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)