MySQL Forums
Forum List  »  Newbie

Re: Select sum(x) >0 with multiple columns
Posted by: Felix Geerinckx
Date: August 01, 2005 03:59AM

gaute wrote:

> $select = "SELECT SUM(S1), SUM(S2), SUM(S3), SUM(S4), SUM(S5), SUM(S6)
> , SUM(S7), SUM(S8), SUM(S9), SUM(S10), SUM(S11)
> , SUM(S12), SUM(S13), SUM(S14)
> WHERE 0 NOT IN (S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13, S14)
> FROM Evaluering";

WHERE should come after FROM.

And you do realize that you will only sum those record in which *none* of the Snn values are equal to zero?

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

Options: ReplyQuote




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.