MySQL Forums
Forum List  »  Newbie

Re: 'Y' or 'N' instead of 1 or 0 on select statement
Posted by: Felix Geerinckx
Date: May 10, 2005 03:10PM

Greg Brendel wrote:

> Can ,I within the select, us simple logic? say something kind of like this:
>
> SELECT ( if (a.answer) then print 'Y' else print 'N') as ynAnswer FROM questions a
> WHERE a.foo=bar

SELECT IF(a.answer, 'Y', 'N') AS ynAnswer FROM questions a

Read more on this so-called control flow functions here:
http://dev.mysql.com/doc/mysql/en/control-flow-functions.html

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

Options: ReplyQuote


Subject
Written By
Posted
Re: 'Y' or 'N' instead of 1 or 0 on select statement
May 10, 2005 03:10PM


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.