| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Cory @ SkyVantage | Date: | November 28 2005 7:38pm |
| Subject: | Re: How to use Logic in View Statment? | ||
| View as plain text | |||
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? SGreen@stripped 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; >
| Thread | ||
|---|---|---|
| • How to use Logic in View Statment? | Scott Klarenbach | 28 Nov |
| • Re: How to use Logic in View Statment? | SGreen | 28 Nov |
| • Re: How to use Logic in View Statment? | Cory @ SkyVantage | 28 Nov |
| • Re: How to use Logic in View Statment? | SGreen | 28 Nov |
| • Re: How to use Logic in View Statment? | Martijn Tonies | 28 Nov |
| • Re: How to use Logic in View Statment? | Scott Klarenbach | 5 Dec |
| • Re: How to use Logic in View Statment? | SGreen | 5 Dec |
| • Re: How to use Logic in View Statment? | Peter Brawley | 28 Nov |
| • RE: How to use Logic in View Statment? | Gelu Gogancea | 28 Nov |
