MySQL Forums
Forum List  »  Newbie

Re: SUM problem.
Posted by: Patric Andersson
Date: March 14, 2009 04:01PM

Ok, I've read that article and well, I might be dumb but I couldn't make heads or tail of it :(

Well, the select should look something like this then ?

SELECT
t1.lepok_users.id AS userid,
t1.firstname,
t1.lastname,
t1.type,
t1.lepok_tourneys.id,
t1.date,
t1.user,
t1.torney,
t1.point,
count(*) AS earlier

FROM lepok_users AS t1,
lepok_result AS t1,
lepok_torneys AS t1

JOIN
lepok_users,
lepok_result,
lepok_torneys AS t2

ON
t1.userid=t2.userid AND
t1.type='$pligan' AND
t1.lepok_torneys.id=t1.torney AND
YEAR(t1.date)=YEAR(CURRENT_DATE())

GROUP BY
t1.userid

HAVEING earlier <= 8;

Or am I completly wrong here ?
And yes, I tried it and it didn't work ofcourse :(
But if I understand what I've just read, it should be something similar to that or ?

Options: ReplyQuote


Subject
Written By
Posted
March 12, 2009 03:29AM
March 12, 2009 09:52AM
March 13, 2009 07:10PM
March 13, 2009 11:10PM
Re: SUM problem.
March 14, 2009 04:01PM
March 14, 2009 06:40PM
March 15, 2009 07:54AM
March 15, 2009 10:41AM
March 15, 2009 10:35PM
March 16, 2009 09:33AM
March 16, 2009 09:52AM
March 16, 2009 02:46PM
March 16, 2009 04:15PM
March 17, 2009 02:11PM
March 17, 2009 05:03PM
March 17, 2009 06:31PM
March 17, 2009 10:17PM
March 18, 2009 06:03AM
March 15, 2009 05:41PM
March 15, 2009 07:14PM
March 16, 2009 08:34AM
March 18, 2009 12:52AM
March 21, 2009 05:58AM
March 21, 2009 11:13AM
March 22, 2009 05:01PM


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.