Click to See Complete Forum and Search --> : does mysql have a strlen function?


mameha1977
10-19-2006, 12:47 AM
I want to do a SQL query using something similar to PHP's strlen.

For example,

"SELECT * FROM table WHERE (strlen(dist_country) > 2)";

Does MySQL have something like this built in?

chazzy
10-19-2006, 06:54 AM
yes, they do

mysql has a decent array of functions at your disposal
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html

the one you're looking for is "length()"