1
1
String Functions and Operators
2
==============================
4
========== ===========================================
6
========== ===========================================
7
LIKE Simple pattern matching
8
NOT LIKE Negation of simple pattern matching
9
STRCMP() Compare two strings
10
========== ===========================================
2
===============================
4
**(See tables with each function listed with a brief description below.)**
17
List of string operators and descriptions by type of function:
20
Comparative and regular functions
21
---------------------------------
23
=================== ====================================================================================================
25
=================== ====================================================================================================
26
LIKE Matches a simple pattern
27
NOT LIKE Negation of simple pattern matching
28
STRCMP() Compare two strings
29
NOT REGEXP Negation of REGEXP
30
REGEXP Returns values that match a regular expression pattern
31
RLIKE Synonym for REGEXP
32
=================== ====================================================================================================
35
Conversion and translation functions
36
------------------------------------
37
=================== ====================================================================================================
39
=================== ====================================================================================================
40
ASCII() Return numeric value of left-most character
41
BIN() Return a string representation of the argument
42
CHAR() Return the character for each integer passed
43
HEX() Return a hexadecimal representation of a decimal or string value
44
LOWER() Return the argument in lowercase
45
LCASE() Synonym for LOWER()
46
UCASE() Synonym for UPPER()
47
UNHEX() Convert each pair of hexadecimal digits to a character
48
UPPER() Convert to uppercase
49
=================== ====================================================================================================
52
Length and size functions
53
-------------------------
54
=================== ====================================================================================================
56
=================== ====================================================================================================
57
BIT_LENGTH() Return length of argument in bits
58
CHAR_LENGTH() Return number of characters in argument
59
LENGTH() Return the length of a string in bytes
60
OCTET_LENGTH() A synonym for LENGTH()
61
=================== ====================================================================================================
64
Formatting and modification functions
65
-------------------------------------
66
=================== ====================================================================================================
68
=================== ====================================================================================================
69
CONCAT() Returns a concatenated string
70
TRIM() Remove leading and trailing spaces
71
LTRIM() Remove leading spaces
72
RTRIM() Remove trailing spaces
73
=================== ====================================================================================================
79
=================== ====================================================================================================
81
=================== ====================================================================================================
82
FIELD() Return the index (position) of the first argument in the sequent arguments
83
FIND_IN_SET() Return the index position of the first argument within the second argument
84
INSTR() Return the index of the first occurrence of substring
85
LEFT() Return the leftmost number of characters as specified
86
INSERT() Insert a substring at the specified position up to the specified number of characters
87
LOCATE() Return the position of the first occurrence of substring
88
POSITION() A synonym for LOCATE()
89
=================== ====================================================================================================
92
Other string functions
93
----------------------
95
=================== ====================================================================================================
97
=================== ====================================================================================================
98
ELT() Return string at index number
99
EXPORT_SET() Return a string
100
FORMAT() Return a number formatted to specified number of decimal places
101
LOAD_FILE() Load the named file
102
LPAD() Return the string argument, left-padded with the specified string
103
MAKE_SET() Return a set of comma-separated strings that have the corresponding bit in bits set
104
MATCH Perform full-text search
105
MID() Return a substring starting from the specified position
106
ORD() Return character code for leftmost character of the argument
107
QUOTE() Escape the argument for use in an SQL statement
108
REPEAT() Repeat a string the specified number of times
109
REPLACE() Replace occurrences of a specified string
110
REVERSE() Reverse the characters in a string
111
RIGHT() Return the specified rightmost number of characters
112
RPAD() Append string the specified number of times
113
SOUNDEX() Return a soundex string
114
SUBSTR() Return the substring as specified
115
SUBSTRING_INDEX() Return a substring from a string before the specified number of occurrences of the delimiter
116
SUBSTRING() Return the substring as specified
117
=================== ====================================================================================================