MySQL Forums
Forum List  »  Newbie

Re: Conditional Column Selections
Posted by: Harrison Fisk
Date: November 23, 2004 05:43PM

Hi,

The IF function or CASE should do work.

For example:

SELECT IF(NICKNAME IS NULL OR NICKNAME = '', concat(FIRSTNAME," ",LASTNAME), concat(NICKNAME," ",LASTNAME)
FROM tbl;

should do what you want.

Options: ReplyQuote


Subject
Written By
Posted
November 23, 2004 10:21AM
Re: Conditional Column Selections
November 23, 2004 05:43PM


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.