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 -> Beginners SQL Puzzle??

Beginners SQL Puzzle??

From: John P <john_at_sessio.com>
Date: Fri, 17 Sep 1999 10:02:14 -0700
Message-ID: <604B2A6B5616F41C.7325921A7576393D.82B33A45BEEFE61E@lp.airnews.net>


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! Received on Fri Sep 17 1999 - 12:02:14 CDT

Original text of this message

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