General discussion

Locked

sql question

By aygul_salahli ·
hello.please help me. i want the students each mark count list for their given marks.but when i write the code like this G and B are taken the same.thanx in advance.


SELECT A.ID,A.NAME,A.SURNAME,COUNT(B.MARK_ID) AS "1",COUNT(G.MARK_ID) AS "2"
FROM
STUDENTS_MARKS B,STUDENTS A LEFT JOIN STUDENTS_MARKS G
ON G.STUDENT_ID=A.ID

WHERE B.MARK_ID=1 AND A.ID=B.STUDENT_ID AND G.MARK_ID=2
GROUP BY A.ID, A.NAME,A.SURNAME ;

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Repost as 'Q&A'

by HAL 9000 Moderator In reply to sql question

Try reposting this in the 'Q&A' forum. The 'Discussion' forum is for matters of general discussion, not specific problems in search of a solution. The 'Water Cooler' is for non-technical discussions. You can submit a question to 'Q&A' here:

http://www.techrepublic.com/forum/questions/post?tag=mantle_skin;content

There are TR members who specifically seek out problems in need of a solution. Although there is some overlap between the forums, you'll find more of those members in 'Q&A' than in 'Discussions' or 'Water Cooler'.

Be sure to use the voting buttons to provide your feedback. Voting a '+' does not necessarily mean that a given response contained the complete solution to your problem, but that it served to guide you toward it. This is intended to serve as an aid to those who may in the future have a problem similar to yours. If they have a ready source of reference available, perhaps won't need to repeat questions previously asked and answered. If a post did contain the solution to your problem, you can also close the question by marking the helpful post as "The Answer".

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums