I have a similar question. How do you test if the field in question
isn't NULL or '' (empty string)? Is the LENGTH a good test or is
there a better way?
[EMAIL PROTECTED] wrote:
LENGTH does exist (as a function):
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
and here is how to use the IF() function:
http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html
I believe this is the equivalent statement you wanted:
SELECT
fieldOne,
fieldTwo,
IF(CHAR_LENGTH(fieldThree)>0,fieldThree,fieldFour) as Company
FROM table;
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]