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
How to add another datafile to a tablespace?
What is redo log?
Can we write dml statement in function in oracle?
Explain table?
Explain the use of parfile option in exp command.
What is a sub query? Describe its types?
What is transport network substrate (tns) in oracle?
Why cursor variables are easier to use than cursors?
What is a database schema in oracle?
What happens if the update subquery returns multiple rows?
How to create a stored procedure in oracle?
why should i declare foreign key constraint as self relation instead of binary relation in tables ?
Explain an index segment?
What is the difference between the Oracle ODBC driver and a Microsoft ODBC (Open Database Connectivity) Driver?
What is the difference between $oracle_base and $oracle_home?