Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Beginners SQL Puzzle??
break on report on leadername skip 1
COMPUTE SUM LABEL 'TOTAL' OF MINUTES on report leadername
select leadername,type,minutes
from two t,one o
where t.classid = o.classid
and type = 'student'
order by o.classid;
In article <604B2A6B5616F41C.7325921A7576393D.82B33A45BEEFE61E_at_lp.airnews.net>, John P <john_at_sessio.com> writes:
>I hope it's OK to ask beginner SQL questions. I just can't seem to
>get my brain to twist in the right direction for this one!
>
>I've got 2 tables (simplified):
>
>Table1
>classid type minutes
> 1 leader 10
> 1 student 3
> 1 student 4
> 1 student 2
> 2 leader 12
> 2 student 7
> 2 student 1
>and so on ....
>
>Table 2
>classid leadername
> 1 Bob
> 2 Sally
>and so on ....
>
>
>What I'm trying to get is a report that looks like:
>
>Bob student 3 minutes
>Bob student 4 minutes
>Bob student 2 minutes
>Total 9 minutes
>
>Sally student 7 minutes
>Sally student 1 minutes
>Total 8 minutes
>
>
>The main thing I can't seem to get to work is to get 'Bob' at the
>start of each line and a total for that classid.
>
>THANKS!
>
Paul in VT Received on Fri Sep 17 1999 - 14:21:46 CDT
![]() |
![]() |