TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

MySQL String

MySQL String with Examples for beginners and professionals on CRUD, mysql, tutorial, examples, insert, query, string, functions, concat_ws(), concat(), character_length(), field(), insert(), key, length() etc.

<< Back to MYSQL

MySQL String 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 size of the specified string.
ELT() The ELT() function returns the Nth element from the list of string.
EXPORT_SET() The EXPORT_SET() function the returns string for each bit set.
FIELD() The FIELD() function returns the index of string.
FIND_IN_SET() The FIND_IN_SET() function returns the value of the string which is given in the first position in the argument.
FORMAT() The FORMAT() function formats the number X to round of D decimal place.
FROM_BASE64() The FROM_BASE64() function encodes the given string to binary format.
HEX() The HEX() function returns the specified number or string in a hexadecimal string.
INSERT() In INSERT() function, a string str is passed with a position 'pos' which tells at which position the character is to be placed, and 'len' length is the length of the character to be placed.
INSTR() The INSTR() function returns the 1st occurrence of substring substr in string str.
LCASE() The LCASE() function returns 1st occurrence of substring substr in string str.
LEFT() The LEFT() function returns left side 'len' characters from the given string 'str'.
LENGTH() The LENGTH() function returns the length of the specified string which is measured in bytes.
LIKE() The LIKE() function returns either 1 or 0 and is used for checking pattern matching.
LOAD_FILE() The LOAD_FILE() function returns the content of the file.
LOCATE() The LOCATE() function returns the first occurrence of given 'substr' in the given string.
LOWER() The LOWER() function returns the given string in lower case.
LPAD() The LPAD() function returns string 'str' which is left-padded to the given length.
LTRIM() The LTRIM() function returns string by removing leading space.
MAKE_SET() The MAKE_SET() function returns values from the set for the given bit.
MID() The MID() function extracts a substring from a string and returns a string with given length and position.
OCTET_LENGTH() The OCTET_LENGTH() function returns length of given string.
OCT() The OCT() function returns length of given string.
ORD() The ORD() function returns the code for the leftmost character if that character is a multi-byte.
POSITION() The POSITION() function returns the position of the given substring in a string.
QUOTE() The QUOTE() function returns the string which is passed in a single quote.
REPEAT() The REPEAT() function repeats a string for a specified number of times.
REPLACE() The REPLACE() function replaces all the occurrences of a substring within a string.
REVERSE() The REVERSE() function reverses a string supplied as an argument.
RIGHT() The RIGHT() function extracts a specified number of characters from the right side of a string.
RPAD() The MYSQL RPAD() function pads the specified strings from the right.
RTRIM() The MYSQL RTRIM() function removes the trailing spaces from the specified string.
SOUNDEX() The MYSQL SOUNDEX() function returns the soundex string for the specified string.

Example 1

SELECT SOUNDEX('TheDeveloperBlog');

Output:

mysql> SELECT SOUNDEX('TheDeveloperBlog');
+-----------------------+
| SOUNDEX('TheDeveloperBlog') |
+-----------------------+
| W6262                 | 
+-----------------------+
1 row in set (0.00 sec)

Example 2

SELECT ORD('mysql');

Output:

mysql> SELECT ORD('mysql'); 
+-------------------+
| ORD('mysql') |
+-------------------+
|               109 | 
+-------------------+
1 row in set (0.00 sec)

Example 3

SELECT REPEAT('*+*',15);

Output:

mysql> SELECT REPEAT('*+*',15); 
+-----------------------------------------------+
| REPEAT('*+*',15)                              |
+-----------------------------------------------+
| *+**+**+**+**+**+**+**+**+**+**+**+**+**+**+* | 
+-----------------------------------------------+
1 row in set (0.03 sec)
Next TopicMySQL String




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf