>What's best way to get the following with a SQL statement? I need to be able to get a list of all of the students that have passed three different tests. All of this data is stored in one table with the student id, test description, score and a logical to indicate pass or fail. Each test is stored in a separate record. Thanks in advance.
Try
SELECT mt.* FROM mytable mt
JOIN mytable mt1 on mt1.studentID = mt.studentID AND mt1.TestId = m.test1 and mt1.passed
JOIN mytable mt2 on mt2.studentID = mt.studentID AND mt2.TestId = m.test2 and mt2.passed
JOIN mytable mt3 on mt3.studentID = mt.studentID AND mt3.TestId = m.test3 and mt3.passed
--sb--