OCTET_LENGTH() Function in MySQL Last Updated : 24 Sep, 2020 Comments Improve Suggest changes Like Article Like Report In this article, we are going to cover the OCTET_LENGTH function. And will see syntax and example of OCTET_LENGTH function. Let's discuss one by one. OCTET_LENGTH function in MySQL is used to returns the number of characters in a given string. Syntax : OCTET_LENGTH( str ) Parameter : This function accepts one parameter as mentioned above in the syntax and described below in the example. str : Given string whose number of characters is to be find. Returns - It returns the length of given string. Example-1 : Applying OCTET_LENGTH() Function to a string. SELECT OCTET_LENGTH('geeksforgeeks') as String_Length; Output : String_Length13 Example-2 : Applying OCTET_LENGTH() Function to a number string. SELECT OCTET_LENGTH(56432) as Length; Output : Length5 Example-3 : Applying OCTET_LENGTH() Function to a column in a table. Table - Student_Details Student_IdStudent_Name134500Amit Singh134501Arunima Rao134502Shreya Sharma134503Leena Mondal Finding total length of name of every student(includes one space). SELECT OCTET_LENGTH(Student_Name) as Name_Length FROM Student_Details ; Output : Name_Length10111312 Comment More infoAdvertise with us Next Article OCTET_LENGTH() Function in MySQL J jana_sayantan Follow Improve Article Tags : DBMS mysql Similar Reads BIT_LENGTH() Function in MySQL BIT_LENGTH() function in MySQL is used to find the length of a given string in bits. The input string can be a character string or number string. Syntax : BIT_LENGTH(str) Parameter : Required. str : A string whose bits length to be calculated. Returns : It returns the length of a given string in bit 1 min read MySQL LENGTH() Function MySQL LENGTH() function returns the length of a string in bytes. SyntaxThe MySQL LENGTH function syntax is: LENGTH(string) ParametersThe LENGTH function accepts only one parameter. string: A specified string whose length is to be counted.MySQL LENGTH() Function ExamplesLet's look at examples of the 1 min read OCT() function in MySQL OCT() function in MySQL is used to convert decimal number to octal. It returns equivalent octal value of a decimal number. Syntax : OCT(number) Parameter : This method accepts only one parameter. number : The decimal number which we want to convert. Returns : It returns octal value of a decimal numb 2 min read CHAR_LENGTH() Function in MySQL CHAR_LENGTH() function in MySQL is used to find the length of a given string (in characters). It counts the number of characters and ignore whether the character(s) are single-byte or multi-byte. Syntax : CHAR_LENGTH(str) Parameter : This method accepts one parameter as mentioned above and described 1 min read LEFT() Function in MySQL The LEFT() function in MySQL is used to extract a specified number of characters from the left side of a given string. It uses its second argument to decide, how many characters it should return. Syntax: LEFT (str, len)Parameter: This function accepts two parameters as mentioned above and described 1 min read Like