1.how to extract the second highest salary from emp table
having sal as a column which contains the salary of all
employee of an organisation.

Answers were Sorted based on User's Feedback



1.how to extract the second highest salary from emp table having sal as a column which contains the..

Answer / ramya

select max(sal) from employees where
sal < (select max(sal) from employees)

Is This Answer Correct ?    21 Yes 2 No

1.how to extract the second highest salary from emp table having sal as a column which contains the..

Answer / neha k

select sal
from (SELECT sal, rownum row_num
FROM emp
order by sal desc)
where row_num = 2;

Is This Answer Correct ?    5 Yes 1 No

1.how to extract the second highest salary from emp table having sal as a column which contains the..

Answer / hema

Select sal from emp a where 2=(select count(distinct sal)
from emp b where a.sal <= b.sal)

Is This Answer Correct ?    2 Yes 2 No

1.how to extract the second highest salary from emp table having sal as a column which contains the..

Answer / esakkiraja

select a.* from(select dense_rank() over(order by sal)as
new_rank from emp) a where new_rank=2

Is This Answer Correct ?    0 Yes 1 No

1.how to extract the second highest salary from emp table having sal as a column which contains the..

Answer / swapna

select top(2) sal from emp where sal order by desc

Is This Answer Correct ?    0 Yes 4 No

1.how to extract the second highest salary from emp table having sal as a column which contains the..

Answer / swapna

select top(1) sal From sample
where sal
in (select top(2) salfrom sample order by saldesc)
order by sal asc

Is This Answer Correct ?    0 Yes 7 No

Post New Answer

More Oracle General Interview Questions

Why do I get java.lang.abstractmethoderror when trying to load a blob in the db?

0 Answers  


How to call a stored function in oracle?

0 Answers  


What are advantages fo Stored Procedures?

1 Answers  


Point out the difference between user tables and data dictionary?

0 Answers  


how to select second mauximum value in a given table under salary column

6 Answers   Sapient,






Explain a private synonyms?

0 Answers  


i have procedure p1.and also i declare the same procedure in a package. whice one is efficient package procedure or procedure?

2 Answers   Microsoft,


1.display list of all users from ur data base.what is the query?

3 Answers   CGI, IBM,


can u call user defined functions in select statements

2 Answers  


What do you know about normalization? Explain in detail?

0 Answers  


Briefly explain what is literal? Give an example where it can be used?

0 Answers  


What is a server parameter file in oracle?

0 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)