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

Home -> Community -> Usenet -> c.d.o.server -> SQL question...

SQL question...

From: Force12 Solutions Ltd <marketing_at_force12.com>
Date: 4 Jun 98 13:59:50 GMT
Message-ID: <01bd8fc2$4e81d1c0$6383209a@gill>


I realise this is more of an SQL question than an Oracle one but I'm doing it
on Oracle and so any Oracle specific functions can be used. I have three tables:

SITE; Site_ID (NUMBER), Site_Name (VARCHAR2)

REPORT_BATCH; Batch_ID (NUMBER), Batch_Name (VARCHAR2)

REPORT_BATCH_MEMBERSHIP; Site_ID (NUMBER), Batch_ID (NUMBER)

Each REPORT_BATCH can contain many SITE's and each SITE can be in many REPORT_BATCH's. The REPORT_BATCH_MEMBERSHIP table contains a record for each batch a site is a member of. The query I need will return a list
of all report batches (BATCH_ID, BATCH_NAME) and also an extra field that says
how many members (SITE's) that batch has. I think I have the concept right - Using
an OUTER JOIN, COUNT(*) and GROUP BY REPORT_BATCH.BATCH_ID but I can't seem to crack it. Could anyone PLEASE help as this is driving me up the wall!
Thanks in advance, hope to hear from someone soon.....

Alex Tait
Force12 Solutions Ltd
ajt_at_force12.com Received on Thu Jun 04 1998 - 08:59:50 CDT

Original text of this message

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