Expand description

String expressions

Functions§

  • Concatenates the text representations of all the arguments. NULL arguments are ignored. concat(‘abcde’, 2, NULL, 22) = ‘abcde222’
  • Concatenates all but the first argument, with separators. The first argument is used as the separator string, and should not be NULL. Other NULL arguments are ignored. concat_ws(‘,’, ‘abcde’, 2, NULL, 22) = ‘abcde,2,22’
  • Returns true if string ends with suffix. ends_with(‘alphabet’, ‘abet’) = ‘t’
  • Converts the first letter of each word to upper case and the rest to lower case. Words are sequences of alphanumeric characters separated by non-alphanumeric characters. initcap(‘hi THOMAS’) = ‘Hi Thomas’
  • Returns the position of the first occurrence of substring in string. The position is counted from 1. If the substring is not found, returns 0. For example, instr(‘Helloworld’, ‘world’) = 6.
  • Returns true if string starts with prefix. starts_with(‘alphabet’, ‘alph’) = ‘t’