1. Queris for Nth maximum Nth row? 2. In One table there are 5 fields. empno, ename, deptcd, managr_id, salary. Select the departments whoose sum of the salary greater than the sum of salaries of any department? 3. When index will be usd in the Query?
Total Answers and Comments: 6
Last Update: June 01, 2007 Asked by: DEBPROSAD BANERJEE
RE: 1. Queris for Nth maximum Nth row?2. In One ...
1. Queris for Nth maximum Nth row?
Select * from (select column_name1, column_name1 from table_name order by column_name) where rownum <= N
2. In One table there are 5 fields. empno, ename, deptcd, managr_id, salary. Select the departments whoose sum of the salary greater than the sum of salaries of any department?
Select deptcd, sum(salary) from table_name group by deptcd orderby salary desc
3. When index will be usd in the Query? Index is used by the Optimizer when a query is fired in Oracle.