Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL help please, it shouldn't be this hard.
Ok here is an example.
In this example Jughead, Todd, Peter, and Mary are managers, and their sales
include those reporting to them.
This is how the report needs to look.
Level Name Total Sales 3 Jughead 15000 2 Todd 12000 1 Peter 7000 1 Mary 3000
In this example salespeople reporting to Mary, and Mary's sales combine to
3000 in sales.
Salespeople reporting to Peter, and Peter's sales combine to 3000 in sales.
Todd's Sales along with his salespeople, and Peter and Mary combine to
12000.
Jughead has non management salespeople reporting to him, along with Todd,
Peter, and Mary for 15000.
The tables are as follows.
EMP
----------------- ------------- EMP_ID number Manager number foreighn key to EMP(emp_id)
SALES_SUMMARY
---------------- ----------------- Sales_id foreign key to EMP(emp_id) tot_sales number
I hope this helps.
TIA
Doug O'Leary <dkoleary_at_mediaone.net> wrote in message
news:MPG.12e064894bb1796498970c_at_nntp.ce.mediaone.net...
> In article <853th9$m9h$3_at_bgtnsc02.worldnet.att.net>,
> jakefound_at_hotmail.com says...
> > I'm trying to write a query that for some reason seems harder than it
should
> > be.
>
> It might help if you posted a short example of what you wanted the report
> to look like and your table definitions. Don't include live data, just
> examples...
>
> Doug
>
> --
> ==============
> Douglas K. O'Leary
> Senior System Admin
> dkoleary_at_mediaone.net
> ==============
Received on Fri Jan 07 2000 - 00:00:00 CST
![]() |
![]() |