GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle
Go To First  |  Previous Question  |  Next Question 
 Oracle  |  Question 27 of 81    Print  
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: 7 Last Update: August 13, 2009     Asked by: DEBPROSAD BANERJEE 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
July 21, 2006 03:27:02   #1  
Ron        

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.


 
Is this answer useful? Yes | No
September 18, 2006 04:21:13   #2  
pavithra T.M        

how to find the staring letters in name

how to find starting letters in names in sql query

e.g sachin tendulkar

i want to display S & T in this name


 
Is this answer useful? Yes | No
September 18, 2006 04:27:36   #3  
pavi        

hike sal

write the query hike the sal of employee

1 year experence 10

less than one year experence 5


 
Is this answer useful? Yes | No
October 12, 2006 02:11:02   #4  
Jagan        

RE: 1. Queris for Nth maximum Nth row?2. In One ...

select salary

from (select rownum rank salary

from ( select salary f

rom emp order by salary desc))where rank &N
/


 
Is this answer useful? Yes | No
October 12, 2006 02:12:14   #5  
Jagan        

RE: 1. Queris for Nth maximum Nth row?2. In One ...

select salary

from(select rownum rank salary

from ( select salary

from emp order by salary desc))

where rank &N
/

this should do the job . . . exactly what you are asking


 
Is this answer useful? Yes | No
June 01, 2007 00:52:39   #6  
Ratheesh        

RE: 1. Queris for Nth maximum Nth row?2. In One ...
select a.dept from emp a emp b
having sum(a.salary)>sum(b.salary)
group by a.dept

 
Is this answer useful? Yes | No
August 13, 2009 02:30:51   #7  
dj_dj_dj Member Since: May 2009   Contribution: 12    

RE: 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?
RE: 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?*))select department max(sum(salary)) from table_name group by department *) Function based index will be used for the above querry.
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape