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
Explain what are the advantages of views?
What is meant by raw datatype?
What do you mean by a deadlock?
What are a cluster and non-cluster index?
What are the uses of Database Trigger ?
What is the difference between sharding and partitioning?
what's query optimization and without use of IN AND Exist can we get another way data from query
What are the differences between char and varchar2 in oracle?
what are bitmap indexes? How does they work?
Explain the difference between a procedure and a function?
What privilege is needed for a user to query tables in another schema?
How to shutdown your 10g xe server from command line?
How to define a sub function?
How to load a large xml file?
How to convert characters to times in oracle?