String functions Flashcards
Returns the ASCII value for the specific character
ASCII
Returns the length of a string (in characters)
CHAR LENGTH
Returns the length of a string (in characters)
CHARACTER LENGTH
Adds two or more expressions together
CONCAT
Adds two or more expressions together with a separator
CONCAT WS
Returns the index position of a value in a list of values
FIELD
Returns the position of a string within a list of strings
FIND IN SET
Formats a number to a format like “#,###,###.##”, rounded to a specified number of decimal places
FORMAT
Inserts a string within a string at the specified position and for a certain number of characters
INSERT
Returns the position of the first occurrence of a string in another string
INSTR
Converts a string to lower-case
LCASE
Extracts a number of characters from a string (starting from left)
LEFT
Returns the length of a string (in bytes)
LENGTH
Returns the position of the first occurrence of a substring in a string
LOCATE
Converts a string to lower-case
LOWER
Left-pads a string with another string, to a certain length
LPAD
Removes leading spaces from a string
LTRIM
Extracts a substring from a string (starting at any position)
MID
Returns the position of the first occurrence of a substring in a string
POSITION
Repeats a string as many times as specified
REPEAT
Replaces all occurrences of a substring within a string, with a new substring
REPLACE
Reverses a string and returns the result
REVERSE
Extracts a number of characters from a string (starting from right)
RIGHT
Right-pads a string with another string, to a certain length
RPAD
Removes trailing spaces from a string
RTRIM
Returns a string of the specified number of space characters
SPACE
Compares two strings
STRCMP
Extracts a substring from a string (starting at any position)
SUBSTR
Extracts a substring from a string (starting at any position)
SUBSTRING
Returns a substring of a string before a specified number of delimiter occurs
SUBSTRING INDEX
Removes leading and trailing spaces from a string
TRIM
Converts a string to upper-case
UCASE
Converts a string to upper-case
UPPER