View previous topic :: View next topic
|
Author |
Message |
vijikesavan
Active User
Joined: 04 Oct 2006 Posts: 118 Location: NJ, USA
|
|
|
|
Hi,
My requirement is like this.
I have two tables
BatXMIT - having details about batch jobs, CPU time and CPU cost
APPLINV - Having Jobgroups, application Ids and owners
I need to get TOP OWNERS by SUM(CPUtime) and SUM(CPU COST)
which can be done by orderby desc on the sum fields and fetch only 25 rows. I am able to get the result till here.
In addition to that I need to get "TOP 25" jobs under each Owner.
So it will be 25 * 25 rows.
Can someone help me with this?
Any pointers will be of more help.
Thanks,
Viji |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Can't you use the selected "TOP 25" owners as the selection criteria for the select of their jobs? |
|
Back to top |
|
|
vijikesavan
Active User
Joined: 04 Oct 2006 Posts: 118 Location: NJ, USA
|
|
|
|
Yes. I did that. But, the result is the TOP 25 jobs of all of them and not per individual.
Say for Owner ABC, 10 top jobs exists and for owner XYZ 15 jobs.
then my result is top 25 from the list of 10+15 jobs and not per owner!
Hope I am clear.
Thanks,
Viji |
|
Back to top |
|
|
wanderer
Active User
Joined: 05 Feb 2007 Posts: 199 Location: Sri Lanka
|
|
|
|
You earlier said that you want 25*25 rows. Are you now saying that there may not be 25 job for each owner and some may have a maximum of 10 or 15 for example?
Please post column names for each of the two tables. And the relation(column name) by which the two tables are related to each other. |
|
Back to top |
|
|
|