MySQL 8 String Functions ( Full List )

MySQL 8 has many built-in functions.

This reference contains string functions in MySQL.


[table caption=”MySQL 8 String Functions list with examples” width=”100%” colwidth=”10%|90%” colalign=”left|left”]
Command, Description
ASCII(), This will return the numeric value of left-most character.
BIN(), This will return a string containing a binary representation of a number.
BIT_LENGTH(), This will return the length of the string passed as input in bits.
CHAR(), This will return the character for each integer passed.
CHAR_LENGTH(), This will return a number of characters in the argument.
CHARACTER_LENGTH(), Synonym for CHAR_LENGTH().
CONCAT(), Return concatenated string.
CONCAT_WS(), Return concatenate the string with separator.
ELT(), Return string at index number.
EXPORT_SET(), Return a string such that for every bit set in the value bits. you get an on string and for every unset bit. you get an off string.
FIELD(), Index (position) of first argument in subsequent arguments.
FIND_IN_SET(), Index (position) of first argument within second argument.
FORMAT(), Return a number formatted to a specified number of decimal places.
FROM_BASE64(), Decode base64 encoded string and return result.
HEX(), Hexadecimal representation of decimal or string value.
INSERT(), Push substring at the specified place up to the specified number of characters.
INSTR(), Return the index of the first occurrence of substring.
LCASE(), Synonym for LOWER().
LEFT(), Return the leftmost number of characters as specified.
LENGTH(), Return the length of a string in bytes.
LIKE, Simple pattern matching.
LOAD_FILE(), Load the named file.
LOCATE(), Return the position of the first occurrence of substring.
LOWER(), Return the argument in lowercase.
LPAD(), Return the string argument left-padded with the specified string.
LTRIM(), Remove leading spaces.
MAKE_SET(), Return a set of comma-separated strings that have the corresponding bit in bits set
MATCH ,Perform full-text search.
MID(), Return a substring starting from the specified position.
NOT LIKE, Negation of simple pattern matching.
NOT REGEXP, Negation of REGEXP.
OCT(), Return a string containing octal representation of a number.
OCTET_LENGTH(), Synonym for LENGTH().
ORD(), Return character code for leftmost character of the argument.
POSITION(), Synonym for LOCATE().
QUOTE(), Escape the argument for use in an SQL statement.
REGEXP, Whether string matches regular expression.
REGEXP_INSTR(), Starting index of substring matching regular expression.
REGEXP_LIKE(), Whether string matches regular expression.
REGEXP_REPLACE(), Replace substrings matching regular expression.
REGEXP_SUBSTR(), Return substring matching regular expression.
REPEAT(), Repeat a string the specified number of times.
REPLACE(), Replace occurrences of a specified string.
REVERSE(), Reverse the characters in a string.
RIGHT(), Return the specified rightmost number of characters.
RLIKE, Whether string matches regular expression.
RPAD(), Append string the specified number of times.
RTRIM(), Remove trailing spaces.
SOUNDEX(), Return a soundex string.
SOUNDS LIKE, Compare sounds.
SPACE(), Return a string of the specified number of spaces.
STRCMP(), Compare two strings.
SUBSTR(), Return the substring as specified.
SUBSTRING(), Return the substring as specified.
SUBSTRING_INDEX(), Return a substring from a string before the specified number of occurrences of the delimiter.
TO_BASE64(), Return the argument converted to a base-64 string.
TRIM(), Remove leading and trailing spaces.
UCASE(), Synonym for UPPER().
UNHEX(), Return a string containing hex representation of a number.
UPPER(), Convert to uppercase.
WEIGHT_STRING(), Return the weight string for a string.
[/table]


Also read PHP Interview Question and Answers for Freshers in detail.

and PHP string functions list here.


jyoti rani

Recent Posts

What Is a Progressive Web App? Why Would You Need One?

App usage is growing steadily without showing any signs of slowing down. Hence, it is no surprise that mobile applications…

12 months ago

7 Most Popular Paid Online Advertising Strategy

As the world has grown more digital, businesses have adapted themselves. An effectual adaptation includes online advertising. Offline advertising styles…

1 year ago

The Importance of User-Centered Design in Mobile App Development

Step into a world where apps dance to the user's tune. Picture Instagram, a photo-sharing sensation that swept the globe.…

1 year ago

Healthcare Mobile App Development: A Complete Guide for Founders

COVID-19 has led to a digitalization of lifestyle. As patients are taking their mental and physical health more seriously, healthcare…

1 year ago

Exploring Diverse WordPress Theme Niches: A Comprehensive Guide

Introduction WordPress, an immensely popular content management system (CMS), powers over 40% of the internet. What makes WordPress even more…

1 year ago

8 Awesome Blog Content Ideas for Movers to Skyrocket the SEO

For moving companies trying to capture their market share amidst stiff competition, a tip or two about what they can…

1 year ago