Find the length of the longest string in MySQL - Mysql Views : 325
Tagged in : Mysql
0 0
Send mail
The LENGTH() function in MySQL returns the length of a string in bytes. Multi-byte characters will count as multiple bytes. The example uses the LENGTH() function but you can substitute them with the CHAR_LENGTH() function instead if you want to count the number of characters rather than bytes.

SELECT LENGTH('this is a test');


This will return the number 14.
By Rekha, On - 2010-01-28



    Login to add Comments .