MySQL String Functions and Operators
Function |
Description |
---|---|
ASCII() |
Return numeric value of left-most character. |
BIN() |
Return a string containing binary representation of a number. |
BIT_LENGTH() |
Return length of argument in bits. |
CHAR() |
Return the character for each integer passed. |
CHAR_LENGTH() |
Return number of characters in argument. |
CONCAT() |
Return concatenated string, |
CONCAT_WS() |
Return concatenate with separator. |
ELT() |
Return string at index number. |
EXPLORE_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. |
FOMRAT() |
Return a number formatted to specified number of decimal places. |
FROM_BASE64() |
Decode base64 encoded string and return result. |
HEX() |
Hexadecimal representation of decimal or string value. |
INSERT() |
Insert substring at specified position up to specified number of characters. |
INSTR() |
Return the index of the first occurrence of substring. |
LCASE() |
Converts to lowercase. |
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. |
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. |
OCT() |
Return a string containing octal representation of a number. |
ORD() |
Return character code for leftmost character of the argument. |
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. |
RTRIM() |
Remove trailing spaces. |
SPACE() |
Return a string of the specified number of spaces. |
STRCMP() |
Compare two strings. |
SUBSTR() |
Return the substring as specified. |
TRIM() |
Remove leading and trailing spaces. |
UPPER() |
Converts to uppercase. |
PL/SQL Strings
We will learn several types of strings, the syntax for declaring a string variable, and then utilizing it in a PL/SQL code block. In PL/SQL, a string is a sequence of characters with an optimal size parameter. Strings are sequences of characters, and PL/SQL provides a rich set of functions and operators to work with them.