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
Answer / ramya
select max(sal) from employees where
sal < (select max(sal) from employees)
| Is This Answer Correct ? | 21 Yes | 2 No |
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 |
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 |
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 |
Answer / swapna
select top(2) sal from emp where sal order by desc
| Is This Answer Correct ? | 0 Yes | 4 No |
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 |
Please explain joins in oracle?
What is execute immediate in oracle?
What privilege is needed for a user to create tables in oracle?
Can objects of the same Schema reside in different tablespaces.?
What are the oracle differences between nvl and coalesce
What is java oracle used for?
can any one help me with import/export options in oracle............
Does a Before form trigger fire when the parameter form is suppressed ?
How to create id with auto_increment on oracle?
How can I create database in oracle?
If a table column has is UNIQUE and has NOT NULL, is it equivalent to a PRIMARY KEY column?
I have query like this. select dept_id, max_mark from stude_dept where min_mark= (select min(mini_mark) from stud_dept); How can i optimize this query. Can anyone help me with it