Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Beginners SQL Puzzle??

Re: Beginners SQL Puzzle??

From: PaulCinVT <paulcinvt_at_aol.com>
Date: 17 Sep 1999 19:21:46 GMT
Message-ID: <19990917152146.01078.00000579@ngol06.aol.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US