tags:

views:

34

answers:

4

Is there any function like "strlen" in mysql?

+2  A: 

Mysql does have a length function to return the length of a string.

so you could do something like.

select * from some_table where length(some_string) > 0;
BrennaSoft
+1  A: 

The following query would do the job for you.

select length(your_text_column) from sample_table where length(some_column) > 0
Bragboy
+2  A: 

How to select one text column, which string length >0 ?

You could compare to the empty string:

SELECT yourcolumn
FROM yourtable
WHERE yourcolumn <> ''
Mark Byers
another clever way, thank you.
lovespring
+1  A: 

You can do it with using LENGTH keyword

SELECT * FROM table WHERE LENGTH (name) > 150;
Judas Imam