Re: SQL query may not be enough, what else should I try?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 21 Mar 2000 00:21:38 +0100
Message-ID: <953594524.26642.0.pluto.d4ee154e_at_news.demon.nl>


The customary solution for the first part is a where not exists correlated subquery

select ...
from studentname a
where not exists
(select 'x'
 from mapping b, classes c
 where classes.category = 'Humanities'
 and b.classid = c.classid
 and b.studentid = a.studentid
)

Reverberation loud enough?

If you want more help, provide table definitions and so on, and I will help you out. Definitely one query, no views involved, and certainly no view or two.

Regards,

Sybrand Bakker, Oracle DBA

Craig Orson Oakland (COO I) <dotacion.nospam_at_st-helena.zzn.com> wrote in message news:8b6ari$75a_at_gap.cco.caltech.edu...
> Environment: Windows NT Reports 2.5 Oracle 10.7 NCA, 7.3
>
> I'm creating a report. I've got three tables to extract data from
> (simplified this for clarity).
>
> Table A holds all the student names, Table B has holds the associations
> between Table A and Table C. Table C contains all classes offered.
>
> I want to learn which students (undergrads) are not currently enrolled in
a
> particular group of classes (e.g. Humanities), and have not accrued at
least
> 18 total units - over the entire time so far spent here. The second part
> I've got, but the first part of that has me stifled for a good solution.
>
> How would I do that? It's kind of like proving a negative. I would guess
I
> could perform several queries, maybe create a view or two, but it gets
more
> complicated because while I have used SQL for querying against conditions
> met, I have not for conditions that haven't been met.
>
> Does this make sense? Have I stated it clearly? I seem to be blocked for
a
> solution at the moment, but putting something in simple terms helps. I
> wasn't coming to you for the answer, just as a sounding board.
>
> Thanks for reverberating
>
>
> Craig
>
>
Received on Tue Mar 21 2000 - 00:21:38 CET

Original text of this message