Notice: session_start(): A session had already been started - ignoring in /home/u614325693/domains/onedoubt.com/public_html/post.php on line 3
LENGTH - ONEDOUBT.COM

Example

Return the length of the string, in bytes:

SELECT LENGTH("SQL Tutorial") AS LengthOfString;

Definition and Usage

The LENGTH() function returns the length of a string (in bytes).

Syntax

LENGTH(string)

Parameter Values

Parameter Description
string Required. The string to count the length for

Technical Details

Works in: From MySQL 4.0

More Examples

Example

Return the length of the text in the "CustomerName" column, in bytes:

SELECT LENGTH(CustomerName) AS LengthOfName
FROM Customers;


Login
ADS CODE