MySQL Forums
Forum List  »  Newbie

Re: sql-command
Posted by: Felix Geerinckx
Date: August 08, 2005 04:08AM

oliver voegeli wrote:

> i'm just curious: why won't it work with:
>
> SELECT
> SUM(IF(answer = 0)) AS 'count Answer 0',
> SUM(IF(answer = 1)) AS 'count Answer 1'
> FROM yourtable;
>
> what are the other two parameters in the if-construct for?

Look it up here: http://dev.mysql.com/doc/mysql/en/control-flow-functions.html

You cannot invent your own syntax and expect it to work.

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

Options: ReplyQuote


Subject
Written By
Posted
August 08, 2005 03:47AM
August 08, 2005 03:52AM
August 08, 2005 04:02AM
Re: sql-command
August 08, 2005 04:08AM
August 08, 2005 05:24AM
August 08, 2005 06:30AM
August 08, 2005 09:29AM


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.