how will I find the first 5 highest salaried employees in
each dept in oracle.
Answer Posted / pawan
Select DISTINCT TOP 5 salary from emp_table1
UNION ALL
Select DISTINCT TOP 5 salary from emp_table2
for more details about UNION and UNION ALL check this: http://www.w3schools.com/sql/sql_union.asp
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Write a trigger example in oracle?
> 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 do I limit the number of rows returned by an oracle query after ordering?
How to do paging with oracle?
How do I reset a sequence in oracle?
How we can able to import our own template (users designed MS-Word templates) which has many tabular columns; need to pass some values generate by Oracle-reports9i? Actually need to import more than 400 MS-Word templates into Oracle Reports-9i to minimize layout design in Reports.
How can I get column names from a table in oracle?
Explain the use of owner option in exp command.
Can we connect to ORACLE db using Windows Authentication?
List the parts of a database trigger.
What is a cognitive schema?
Why do I get java.lang.abstractmethoderror when trying to load a blob in the db?
What is data file?
How to select all columns of all rows from a table in oracle?
What are the differences between date and timestamp in oracle?