MySQL Forums
Forum List  »  Newbie

Re: sql-command
Posted by: oliver voegeli
Date: August 08, 2005 04:02AM

thx for answer.

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?

greetz
oliver

Options: ReplyQuote


Subject
Written By
Posted
August 08, 2005 03:47AM
August 08, 2005 03:52AM
Re: sql-command
August 08, 2005 04:02AM
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.