Re: SQL Select
Date: 1997/10/01
Message-ID: <34321E72.51F9251D_at_stibo.dk>#1/1
This is a multi-part message in MIME format.
--------------E403068FB3F1EF916B652A10 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit
<HTML>
<TT>SELECT s.STUDENT</TT>
<BR><TT>FROM STUDENT s</TT>
<BR><TT>WHERE s.STUDENTID IN (</TT>
<BR><TT> SELECT t.STUDENTID</TT>
<BR><TT> FROM TAKEN t</TT>
<BR><TT> GROUP BY t.STUDENTID</TT>
<BR><TT> HAVING COUNT(1) >= 2)</TT>
<BR>
<P>Mark McCubbin wrote:
<BLOCKQUOTE TYPE=CITE>I need help with an SQL query to determine which
students have taken two
<BR>or more courses. For example, what is the most efficient way to answer
<BR>the question: who has taken all three classes CS101, CS200, and
CS300?
<P>The tables are as follows (the relationship is one to many):
<P>STUDENT
<BR>StudentID
<BR>FirstName
<BR>LastName
<P>TAKEN
<BR>ClassTitle
<BR>StudentID</BLOCKQUOTE>
</HTML>
--------------E403068FB3F1EF916B652A10 Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Jørn Hansen Content-Disposition: attachment; filename="vcard.vcf" begin: vcard fn: Jørn Hansen n: Hansen;Jørn org: Stibo Datagrafik email;internet: joh_at_stibo.dk tel;work: +45 8939 1189 tel;fax: +45 8939 1112 tel;home: +45 8624 0154
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
end: vcard
--------------E403068FB3F1EF916B652A10-- Received on Wed Oct 01 1997 - 00:00:00 CEST