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 load a large xml file?

0 Answers  


What is Hash Cluster ?

2 Answers  


What is different types of joins?

0 Answers  


definition of cluster and non-clustered index?

0 Answers   CSS,


emp numb is unique because that is primary key,,but what is foreign key .. explain very clear with example

1 Answers  


How to load data from external tables to regular tables?

0 Answers  


What are the uses of Database Trigger ?

0 Answers  


interview questions with answer for cts

0 Answers   Cognizant,


what is difference between DBMS and RDBMS?

2 Answers   Metric Stream,


write a query that displays every Friday in a year with date?

5 Answers   Flipkart, HCL, TCS,


How will you identify oracle database software release?

0 Answers  


select trunc(round(156.00,-1),-1) from dual;

2 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1808)
  • 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)