MySQL LENGTH() Function17 Mar 2025 | 1 min read LENGTH(str) is a Sring function of MySQL. This method returns length of the given string ?str? which is measured in bytes. SyntaxExample 1Output: ![]() Example 2Output: ![]() Next TopicMySQL String |
MySQL LTRIM() Function LTRIM(str) is a Sring function of MySQL. This method returns string by removing leading space. Syntax select ltrim(str); Example 1 Select ltrim(' Javatpoint'); Output: Example 2 Select ltrim(' MySql '); Output: TopicMySQL String ...
1 min read
MySQL LOAD_FILE() Function LOAD_FILE(file_name) is a Sring function of MySQL. This method returns content of file. If file does not exist or it cannot be read then it returns NULL. Syntax LOAD_FILE(file_name); Example 1 Update table1 set img= LOAD_FILE('D:\image_file.jpg'); Output: TopicMySQL String ...
1 min read
MySQL FORMAT() Function Format(X,D[,locale]) is a Sring function of MySQL. This method formats the number X to round of D decimal place Syntax select format(X,D[locale]); Example 1 select format(12345.6789,3); Output: Example 2 select format(7895.563,3); Output: Example 3 select format(4539.235,2); Output: TopicMySQL String ...
1 min read
MySQL MID() Function MID(str,pos,len) is a Sring function of MySQL. This method returns string of given length and position. Syntax select mid(str, pos, len); Example 1 Select mid('mysql', 3, 4); Output: Example 2 Select mid('Javatpoint', 6, 6); Output: TopicMySQL String ...
1 min read
MySQL LOCATE() Function LOCATE(substr,str) is a Sring function of MySQL. This method returns the first occurrence of given substr in the given string, Syntax select locate(substr, str); Example 1 select locate('point', 'javatpoint'); Output: Example 2 select locate('sql, 'mysql'); Output: TopicMySQL String ...
1 min read
MySQL SUBSTR() Function The substr() is a String function of MySQL. This function returns the substring from the given string. Syntax select substr(Str, pos); Select substr(Str from pos); Select substr(Str, pos, len); Select substr(Str from pos for len); Parameter: Str: Main string Len: length for substring Pos: position the start the substring from the given string. Example...
1 min read
MySQL MAKE_SET() Function MAKE_SET(bits,str1,str2,...) is a Sring function of MySQL. This method returns values from set for the given bit. Syntax select make_set(bits, str1, str2,...); Example 1 Select make_set(1, 'apple','mango','grapes'); Output: Example 2 Select make_set(1|3, 'apple','mango','grapes'); Output: Example 3 Select make_set(1|4, 'apple','mango','grapes'); Output: Example 4 Select make_set(4, 'apple','mango','grapes'); Output: TopicMySQL String ...
1 min read
MySQL STRCMP() Function The strcmp() is a String function of MySQL. This function compares the given two strings. This function returns 0 if both the strings are same, -1 if the first string is smaller than second else it returns 1. Syntax select strcmp(str1, str2); Parameters: Str1 and str2: two strings...
1 min read
MySQL FIELD() Function Field(str,str1,str2,str3,....) is a Sring function of MySQL. This method returns the index of string. Syntax select field(str,str1,str2,str3,...) Example 1 Selct field('a','b','c','d','a'); Output: Example 2 Selct field(4,1,2,3,5,4,6); Output: Example 3 Selct field(12,1,2,3,4,6); Output: TopicMySQL String ...
1 min read
Function MySQL string functions manipulate the character string data effectively. The following table indicates each of the functions with a brief description: Functions Description CONCAT_WS() MySQL CONCAT_WS() function returns a string by concatenating arguments using separator. CONCAT() The CONCAT() function returns a string by concatenating all the arguments. CHARACTER_LENGTH() The CHARACTER_LENGTH() function returns the...
3 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India