Return the length of the string:
SELECT CHAR_LENGTH("SQL Tutorial") AS LengthOfString;
Try it Yourself »
The CHAR_LENGTH() function return the length of a string (in characters).
Note: This function is equal to the CHARACTER_LENGTH() function.
CHAR_LENGTH(
string)
Parameter | Description |
---|---|
string | Required. The string to count the length for |
Works in: | From MySQL 4.0 |
---|
Return the length of the text in the "CustomerName" column:
SELECT CHAR_LENGTH(CustomerName) AS LengthOfName
FROM Customers;
Try it Yourself »
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!