find out the second highest salary?
Answer Posted / hari kanth
select sal from(select sal,rank() over(order by sal desc)
rnk from emp) e
where e.rnk=2;
(OR)
select rownum,sal from emp group by sal,rownum
having rownum=2;
(OR)
select rn,sal from( select rownum rn,sal from emp group by
sal,rownum order by sal desc)
where rn=2;
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
What is the difference between "as" and "is" in an oracle stored procedure?
What are the tools for Oracle ?
Can you drop an index associated with a unique or primary key constraint?
How to start instance with a minimal initialization parameter file?
How to rename an index in oracle?
How to name query output columns in oracle?
What happens if recursive calls get out of control?
How to create a single index for multiple columns?
Difference between cartesian join and cross join?
Explain the use of full option in exp command.
Hi friends can u send the oracle 9i full version download link?????????????? please reply ?
What is SQL access advisor in Oracle?
How to add another datafile to a tablespace?
What is merge statement used for?
What is BBED in Oracle?