Arno Coetzee wrote:

Jason Chan wrote:

I have a student Table and a SubjectGrade table

<snip>

I want to find out students who have got A in both Maths and Chem
How the SQL look like?

select s.StudentID , s.StudentName
from Student as s , SubjectGrade as sj
where s.studentID = sj.studentID and sj.Grade = 'A' and (sj.Subject = 'Maths' or sj.Subject = 'Chem')

This will work, but you'll get 2 rows per student, one for each subject.

Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to