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 |
I need to get the values of the previous quarter.how to do this?eg: if my cuurent month is may i need to get the datas of the month jan,feb,march.Can it be done in oracle.I tried with date function q but for the month jan its not retriving the previous quarter(oct-dec).how to solve this.plpz anyone help me?
How to get a list of all user accounts in the database?
What is Database Buffers ?
How to define an anonymous block?
How to drop a tablespace?
What are the limitations oracle database 10g xe?
Please help me how to write a Query to change the primary key constraint from 1 attribute to another attribute in a table
Explain what are synonyms used for?
How to speed up webrick?
How do I call oracle stored procedures that take no parameters?
Difference between NO DATA FOUND and %NOTFOUND?
What is bind variable in oracle 11g?