SELECT CHARACTER_LENGTH('Welcome to plus2net')
Output is 19
SELECT LENGTH(_utf8 '€'), CHARACTER_LENGTH(_utf8 '€')
Output is
3, 1
SELECT character_length(title) as no, title FROM `photo_img` where img_id=47
Without giving any where clause we can display the length of all the titles along with the title for the total table. Let us try to find out what are the titles using maximum space or the titles of maximum length. This will display records with maximum character in the title field. This we will manage by using sql order by clause. Check this query.
SELECT character_length(title) as no, title FROM `photo_img` order by no desc
SQL String ReferencesSQL to get length of string
substring_index to get part of string using delimiter
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.