MySQL: String Functions List

Profile picture for user arilio666

Here is a list of string functions available in MySQL.

  1. ASCII: This gives out the ASCII value for the specific character.
  2. CHAR_LENGTH: This gives out the length of the string.
  3. CHARACTER_LENGTH: This too gives out the length of a string.
  4. CONCAT: This function adds two or more expressions same together.
  5. CONCAT_WS: This function adds one or more expressions together followed by a separator.
  6. FIELD: This one returns the index of a value in a list of values.
  7. FIND_IN_SET: This function returns the position of a string within list of strings
  8. FORMAT: This function formats a number like "*,***,***.**", rounded to a specified number of decimal places.
  9. INSERT: This function inserts a string within a string at the targeted position and for a certain number of characters
  10. INSTR: This function returns the exact position of the first occurrence of a string in another string
  11. LCASE: This function converts string to lower-case
  12. LEFT: This function extracts characters from a string from the left side.
  13. LENGTH: This function returns the precise length of a string usually in bytes.
  14. LOCATE: This function returns the position of the first occurrence of a substring in a string
  15. LOWER: This function converts a string to lower-case
  16. LPAD: This function Left-pads a string with another string.
  17. LTRIM: This function removes leading trail spaces from a string
  18. MID: This one extracts a substring from a string from any place.
  19. POSITION: This one returns the position of the first occurrence of a substring in a string.
  20. REPEAT: This function repeats a string as many times as specified.
  21. REPLACE: This function replaces occurrences of a substring within a string with a new substring.
  22. REVERSE: This function reverses a string.
  23. RIGHT: This function extracts characters from a string from right side.
  24. RPAD: This function right-pads a string with another string.
  25. RTRIM: This one removes trailing spaces from string.
  26. SPACE: This function returns string of the specified number of space characters.
  27. STRCMP: This compares two strings.
  28. SUBSTR: This function extracts substring from a string from any place.
  29. SUBSTRING: This function extracts substring from a string from any position.
  30. SUBSTRING_INDEX: This one returns a substring of a string before delimiter occurs according to the specified number.
  31. TRIM: This function eliminates leading and trailing spaces from a string.
  32. UCASE: This function converts a string to upper-case
  33. UPPER: This also converts a string to upper-case
Tags