MySQL Functions (JNNC Technologies)


MySQL has many built-in functions.
This reference contains the string, numeric, date, and advanced functions in MySQL.

MySQL String Functions

FunctionDescription
MySQLReturns the number code that represents the specific character
CHAR_LENGTHReturns the length of the specified string (in characters)
CHARACTER_LENGTHReturns the length of the specified string (in characters)
CONCATConcatenates two or more expressions together
CONCAT_WSConcatenates two or more expressions together and adds a separator between them
FIELDReturns the position of a value in a list of values
FIND_IN_SETReturns the position of a string in a string list
FORMATFormats a number as a format of "#,###.##", rounding it to a certain number of decimal places
INSERTInserts a substring into a string at a specified position for a certain number of characters
INSTRReturns the position of the first occurrence of a string in another string
LCASEConverts a string to lower-case
LEFTExtracts a substring from a string (starting from left)
LENGTHReturns the length of the specified string (in bytes)
LOCATEReturns the position of the first occurrence of a substring in a string
LOWERConverts a string to lower-case
LPADReturns a string that is left-padded with a specified string to a certain length
LTRIMRemoves leading spaces from a string
MIDExtracts a substring from a string (starting at any position)
POSITIONReturns the position of the first occurrence of a substring in a string
REPEATRepeats a string a specified number of times
REPLACEReplaces all occurrences of a specified string
REVERSEReverses a string and returns the result
RIGHTExtracts a substring from a string (starting from right)
RPADReturns a string that is right-padded with a specified string to a certain length
RTRIMRemoves trailing spaces from a string
SPACEReturns a string with a specified number of spaces
STRCMPTests whether two strings are the same
SUBSTRExtracts a substring from a string (starting at any position)
SUBSTRINGExtracts a substring from a string (starting at any position)
SUBSTRING_INDEXReturns the substring of string before number of occurrences of delimiter
TRIMRemoves leading and trailing spaces from a string
UCASEConverts a string to upper-case
UPPERConverts a string to upper-case

Post a Comment

0 Comments

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();