[mysql] MySQL SELECT statement for the "length" of the field is greater than 1

I have an LINK field in my table. Some rows have a link, some don't.

I'd like to select all rows where LINK is present. (length is greater than X characters).

How do I write this?

This question is related to mysql

The answer is


Try:

SELECT
    *
FROM
    YourTable
WHERE
    CHAR_LENGTH(Link) > x

select * from [tbl] where [link] is not null and len([link]) > 1

For MySQL user:

LENGTH([link]) > 1

Just in case anybody want to find how in oracle and came here (like me), the syntax is

select length(FIELD) from TABLE

just in case ;)