i need department wise top 2 employees salary.which logic
i will use

Answer Posted / shreya

select level,deptno,max(sal)
from emp
where level in (1,2)
connect byy prior sal>sal
group by level,deptno
order by deptno

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql keyword?

559


What is the difference between explicit and implicit cursors in oracle?

512


Explain some predefined exceptions.

582


What is the difference between row level and statement level trigger?

517


What is constant in pl sql?

515






What are aggregate and scalar functions?

521


What is union and union all keyword in sql and what are their differences?

574


Could you please provide oca (oracle 10g) dumps for my certification ?

4508


Why are aggregate functions called so?

510


What is ttitle and btitle?

572


Is drop table faster than truncate?

547


I need a function for a train ticket reservation please answer it thanks in advance

561


How do you exit in sql?

587


What is a behavioral trigger?

513


Write the order of precedence for validation of a column in a table? I. Done using database triggers. Ii. Done using integarity constraints

640