how will I find the first 5 highest salaried employees in
each dept in oracle.
Answer Posted / kanha
Select E1.* From(Select Ename,Deptno,Sal,
Dense_Rank()over
(
Partition By Deptno Order By Sal Desc
)"Top Sal"
From Emp)E1
Where "Top Sal"<=5 Order By Deptno,Sal Desc;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
When do you get a .pll extension in oracle?
How to write a query with an inner join in oracle?
ur a sql devoloper...what is the process in ur company for finding the database BUGS .. seperate DB testers are there? or devr.s are manage? if DB TESTERS in there what is the process
What is a table index?
What's dateware house and what's clustor with practicle example
What is the difference between substr & instr functions?
How many memory layers are in the oracle shared pool?
HI Friends Myself Manoj,i am from bengaluru.i have 1 yr of exp in PLSQL but not upto the mark..now attending interviews but m not able to clear even 1 round..i have attended 3 interviews till today.purpose of writing this query is,i want to know the intreview topics that interviewer going to ask frequently,mainly SCENARIO based questions.IF anybody have any PLSQL projects please give it to me,it will helps me alot.Thanks for your patience.
Which dictionary tables and/or views would you look at to diagnose a locking issue?
How many file formats are supported to export data?
what happened to the global index when I truncate the data in one of the partition?
> CREATE OR REPLACE FUNCTION FACTORIAL_1(factstr varchar2 ) 2 RETURN NUMBER AS 3 new_str VARCHAR2(4000) := factstr||'*' ; 4 fact number := 1 ; 5 BEGIN 6 7 WHILE new_str IS NOT NULL 8 LOOP 9 fact := fact * TO_NUMBER(SUBSTR(new_str,1,INSTR(new_str,'*')-1)); 10 new_str := substr( new_str,INSTR(new_str,'*')+1); 11 END LOOP; 12 13 RETURN fact; 14 15 END; explanation Above program?
How to work with data objects interactively?
State the various uses of dbcc command?
How to run the anonymous block again?