Help with sql query
Posted
by user225269
on Stack Overflow
See other posts from Stack Overflow
or by user225269
Published on 2010-03-20T13:51:17Z
Indexed on
2010/03/20
14:21 UTC
Read the original article
Hit count: 150
I have two tables: subject and student. I'm trying to count the number of subjects enrolled by each student. How do I do that?I'm trying the code below but it doesn't give the answer I need. Please help.
SELECT COUNT( subject.SUBJECT ) , student.IDNO, student.FIRSTNAME, subject.SUBJECT
FROM student, subject
GROUP BY subject.SUBJECT
LIMIT 0 , 30
© Stack Overflow or respective owner