/MDACC)
Subject: Re: CASE statement within SUM()
At 11:29 -0500 3/7/03, Peter D Bethke wrote:
>Hello listers,
>
>In mysql, is it possible imbed a conditional CASE statement within a SUM()
>function to effect how the SUM() returns the final value for a set of rows?
>
>For exampl
At 11:29 -0500 3/7/03, Peter D Bethke wrote:
Hello listers,
In mysql, is it possible imbed a conditional CASE statement within a SUM()
function to effect how the SUM() returns the final value for a set of rows?
For example, if I have a table "foo" with column "score", and "score" has
the rows with
Peter,
I think something like this will work:
mysql> select sum( if(score=7, score * 2, score)) from table_name;
David
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mys
Hello listers,
In mysql, is it possible imbed a conditional CASE statement within a SUM()
function to effect how the SUM() returns the final value for a set of rows?
For example, if I have a table "foo" with column "score", and "score" has
the rows with the values 1 to 10, can I write the SUM() i