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 |
Explain oracle insert into command?
How many memory layers are in the oracle shared pool?
What is the difference between substr and instr?
Can you tell me how to add new column in existing views?how?How is possible?
Please explain oracle data types with examples?
How can you merge two tables in oracle?
What happens to the current transaction if the session is ended?
How to get a list of all user accounts in the database?
State the difference along with examples between Oracle 9i, Oracle 10g and Oracle 11i.
How to create lov dynamically at runtime & attach to text field?
What are the ways tablespaces can be managed and how do they differ?
i can create a view with two columns from emp table,, later i need to add one more emp column to existing view.. what is query similarly add one more column to existing primary key constraint.. please give me the solutions