MySQL Forums
Forum List  »  Newbie

Re: Selecting from two tables
Posted by: Felix Geerinckx
Date: March 28, 2006 04:59AM

Amofa Kodom Baffoe wrote:
> I have three tables as follows:

I only see two.

> Any select statement to select studentid, finalexam marks and continuos assessment marks
> summed up for each module?

SELECT f.studentid, f.module, f.marks, COALESCE(SUM(ca.marks),0)
FROM finalexam f
LEFT JOIN contassessment ca ON ca.studentid = f.studentid AND ca.module = f.module
GROUP BY f.studentid, f.module, f.marks

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
Re: Selecting from two tables
March 28, 2006 04:59AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.