What about:
SELECT * FROM sometable WHERE CHAR_LENGTH(LINK) > 1
Here is the MySql (5.0) line functions page .
Note that instead of LENGTH I chose CHAR_LENGTH , as if the data that you are probably really interested in is how many characters there are, and not how many bytes of memory that they accept, there are multibyte characters. Thus, for the above, a string in which LINK is the only double-byte character will not be returned, whereas when using LENGTH .
Note that if LINK is NULL , the result of CHAR_LENGTH(LINK) will also be NULL , so the string will not match.
Jon Skeet Oct 09 '09 at 18:54 2009-10-09 18:54
source share