The following table provides a list of all the functions and operators supported across MySQL 5.0, 5.1, 5.4, and 5.5.
Table 3.1. Operators/Functions Reference
Name | Introduced | Deprecated | 5.0 | 5.1 | 5.4 | 5.5 |
---|---|---|---|---|---|---|
ABS() |
yes | yes | yes | yes | ||
ACOS() |
yes | yes | yes | yes | ||
ADDDATE() |
v4.1.1 | yes | yes | yes | yes | |
ADDTIME() |
v4.1.1 | yes | yes | yes | yes | |
AES_DECRYPT() |
yes | yes | yes | yes | ||
AES_ENCRYPT() |
yes | yes | yes | yes | ||
AND , &&
|
yes | yes | yes | yes | ||
ASCII() |
yes | yes | yes | yes | ||
ASIN() |
yes | yes | yes | yes | ||
ATAN2() , ATAN()
|
yes | yes | yes | yes | ||
ATAN() |
yes | yes | yes | yes | ||
AVG() |
yes | yes | yes | yes | ||
BENCHMARK() |
yes | yes | yes | yes | ||
BETWEEN ... AND ... |
yes | yes | yes | yes | ||
BIN() |
yes | yes | yes | yes | ||
BINARY |
yes | yes | yes | yes | ||
BIT_AND() |
yes | yes | yes | yes | ||
BIT_COUNT() |
yes | yes | yes | yes | ||
BIT_LENGTH() |
yes | yes | yes | yes | ||
BIT_OR() |
yes | yes | yes | yes | ||
BIT_XOR() |
v4.1.1 | yes | yes | yes | yes | |
& |
yes | yes | yes | yes | ||
~ |
yes | yes | yes | yes | ||
| |
yes | yes | yes | yes | ||
^ |
yes | yes | yes | yes | ||
CASE |
yes | yes | yes | yes | ||
CAST() |
yes | yes | yes | yes | ||
CEIL() |
yes | yes | yes | yes | ||
CEILING() |
yes | yes | yes | yes | ||
CHAR_LENGTH() |
yes | yes | yes | yes | ||
CHAR() |
yes | yes | yes | yes | ||
CHARACTER_LENGTH() |
yes | yes | yes | yes | ||
CHARSET() |
v4.1.0 | yes | yes | yes | yes | |
COALESCE() |
yes | yes | yes | yes | ||
COERCIBILITY() |
v4.1.1 | yes | yes | yes | yes | |
COLLATION() |
v4.1.0 | yes | yes | yes | yes | |
COMPRESS() |
v4.1.1 | yes | yes | yes | yes | |
CONCAT_WS() |
yes | yes | yes | yes | ||
CONCAT() |
yes | yes | yes | yes | ||
CONNECTION_ID() |
yes | yes | yes | yes | ||
CONV() |
yes | yes | yes | yes | ||
CONVERT_TZ() |
v4.1.3 | yes | yes | yes | yes | |
Convert() |
yes | yes | yes | yes | ||
COS() |
yes | yes | yes | yes | ||
COT() |
yes | yes | yes | yes | ||
COUNT(DISTINCT) |
yes | yes | yes | yes | ||
COUNT() |
yes | yes | yes | yes | ||
CRC32() |
v4.1.0 | yes | yes | yes | yes | |
CURDATE() |
yes | yes | yes | yes | ||
CURRENT_DATE() , CURRENT_DATE
|
yes | yes | yes | yes | ||
CURRENT_TIME() , CURRENT_TIME
|
yes | yes | yes | yes | ||
CURRENT_TIMESTAMP() , CURRENT_TIMESTAMP
|
yes | yes | yes | yes | ||
CURRENT_USER() , CURRENT_USER
|
yes | yes | yes | yes | ||
CURTIME() |
yes | yes | yes | yes | ||
DATABASE() |
yes | yes | yes | yes | ||
DATE_ADD() |
yes | yes | yes | yes | ||
DATE_FORMAT() |
yes | yes | yes | yes | ||
DATE_SUB() |
yes | yes | yes | yes | ||
DATE() |
v4.1.1 | yes | yes | yes | yes | |
DATEDIFF() |
v4.1.1 | yes | yes | yes | yes | |
DAY() |
v4.1.1 | yes | yes | yes | yes | |
DAYNAME() |
v4.1.21 | yes | yes | yes | yes | |
DAYOFMONTH() |
yes | yes | yes | yes | ||
DAYOFWEEK() |
yes | yes | yes | yes | ||
DAYOFYEAR() |
yes | yes | yes | yes | ||
DECODE() |
yes | yes | yes | yes | ||
DEFAULT() |
yes | yes | yes | yes | ||
DEGREES() |
yes | yes | yes | yes | ||
DES_DECRYPT() |
yes | yes | yes | yes | ||
DES_ENCRYPT() |
yes | yes | yes | yes | ||
DIV |
v4.1.0 | yes | yes | yes | yes | |
/ |
yes | yes | yes | yes | ||
ELT() |
yes | yes | yes | yes | ||
ENCODE() |
yes | yes | yes | yes | ||
ENCRYPT() |
yes | yes | yes | yes | ||
<=> |
yes | yes | yes | yes | ||
= |
yes | yes | yes | yes | ||
EXP() |
yes | yes | yes | yes | ||
EXPORT_SET() |
yes | yes | yes | yes | ||
EXTRACT() |
yes | yes | yes | yes | ||
ExtractValue() |
v5.1.5 | yes | yes | yes | ||
FIELD() |
yes | yes | yes | yes | ||
FIND_IN_SET() |
yes | yes | yes | yes | ||
FLOOR() |
yes | yes | yes | yes | ||
FORMAT() |
yes | yes | yes | yes | ||
FOUND_ROWS() |
yes | yes | yes | yes | ||
FROM_DAYS() |
yes | yes | yes | yes | ||
FROM_UNIXTIME() |
yes | yes | yes | yes | ||
GET_FORMAT() |
v4.1.1 | yes | yes | yes | yes | |
GET_LOCK() |
yes | yes | yes | yes | ||
>= |
yes | yes | yes | yes | ||
> |
yes | yes | yes | yes | ||
GREATEST() |
yes | yes | yes | yes | ||
GROUP_CONCAT() |
v4.1 | yes | yes | yes | yes | |
HEX() |
yes | yes | yes | yes | ||
HOUR() |
yes | yes | yes | yes | ||
IF() |
yes | yes | yes | yes | ||
IFNULL() |
yes | yes | yes | yes | ||
IN() |
yes | yes | yes | yes | ||
INET_ATON() |
yes | yes | yes | yes | ||
INET_NTOA() |
yes | yes | yes | yes | ||
INSERT() |
yes | yes | yes | yes | ||
INSTR() |
yes | yes | yes | yes | ||
INTERVAL() |
yes | yes | yes | yes | ||
IS_FREE_LOCK() |
yes | yes | yes | yes | ||
IS NOT NULL |
yes | yes | yes | yes | ||
IS NOT |
yes | yes | yes | yes | ||
IS NULL |
yes | yes | yes | yes | ||
IS_USED_LOCK() |
v4.1.0 | yes | yes | yes | yes | |
IS |
yes | yes | yes | yes | ||
ISNULL() |
yes | yes | yes | yes | ||
LAST_DAY |
v4.1.1 | yes | yes | yes | yes | |
LAST_INSERT_ID() |
yes | yes | yes | yes | ||
LCASE() |
yes | yes | yes | yes | ||
LEAST() |
yes | yes | yes | yes | ||
<< |
yes | yes | yes | yes | ||
LEFT() |
yes | yes | yes | yes | ||
LENGTH() |
yes | yes | yes | yes | ||
<= |
yes | yes | yes | yes | ||
< |
yes | yes | yes | yes | ||
LIKE |
yes | yes | yes | yes | ||
LN() |
yes | yes | yes | yes | ||
LOAD_FILE() |
yes | yes | yes | yes | ||
LOCALTIME() , LOCALTIME
|
yes | yes | yes | yes | ||
LOCALTIMESTAMP , LOCALTIMESTAMP()
|
v4.0.6 | yes | yes | yes | yes | |
LOCATE() |
yes | yes | yes | yes | ||
LOG10() |
yes | yes | yes | yes | ||
LOG2() |
yes | yes | yes | yes | ||
LOG() |
yes | yes | yes | yes | ||
LOWER() |
yes | yes | yes | yes | ||
LPAD() |
yes | yes | yes | yes | ||
LTRIM() |
yes | yes | yes | yes | ||
MAKE_SET() |
yes | yes | yes | yes | ||
MAKEDATE() |
v4.1.1 | yes | yes | yes | yes | |
MAKETIME |
v4.1.1 | yes | yes | yes | yes | |
MASTER_POS_WAIT() |
yes | yes | yes | yes | ||
MATCH |
yes | yes | yes | yes | ||
MAX() |
yes | yes | yes | yes | ||
MD5() |
yes | yes | yes | yes | ||
MICROSECOND() |
v4.1.1 | yes | yes | yes | yes | |
MID() |
yes | yes | yes | yes | ||
MIN() |
yes | yes | yes | yes | ||
- |
yes | yes | yes | yes | ||
MINUTE() |
yes | yes | yes | yes | ||
MOD() |
yes | yes | yes | yes | ||
% |
yes | yes | yes | yes | ||
MONTH() |
yes | yes | yes | yes | ||
MONTHNAME() |
v4.1.21 | yes | yes | yes | yes | |
NAME_CONST() |
v5.0.12 | yes | yes | yes | yes | |
NOT BETWEEN ... AND ... |
yes | yes | yes | yes | ||
!= , <>
|
yes | yes | yes | yes | ||
NOT IN() |
yes | yes | yes | yes | ||
NOT LIKE |
yes | yes | yes | yes | ||
NOT REGEXP |
yes | yes | yes | yes | ||
NOT , !
|
yes | yes | yes | yes | ||
NOW() |
yes | yes | yes | yes | ||
NULLIF() |
yes | yes | yes | yes | ||
OCT() |
yes | yes | yes | yes | ||
OCTET_LENGTH() |
yes | yes | yes | yes | ||
OLD_PASSWORD() |
v4.1 | yes | yes | yes | yes | |
|| , OR
|
yes | yes | yes | yes | ||
ORD() |
yes | yes | yes | yes | ||
PASSWORD() |
yes | yes | yes | yes | ||
PERIOD_ADD() |
yes | yes | yes | yes | ||
PERIOD_DIFF() |
yes | yes | yes | yes | ||
PI() |
yes | yes | yes | yes | ||
+ |
yes | yes | yes | yes | ||
POSITION() |
yes | yes | yes | yes | ||
POW() |
yes | yes | yes | yes | ||
POWER() |
yes | yes | yes | yes | ||
PROCEDURE ANALYSE() |
yes | yes | yes | yes | ||
QUARTER() |
yes | yes | yes | yes | ||
QUOTE() |
yes | yes | yes | yes | ||
RADIANS() |
yes | yes | yes | yes | ||
RAND() |
yes | yes | yes | yes | ||
REGEXP |
yes | yes | yes | yes | ||
RELEASE_LOCK() |
yes | yes | yes | yes | ||
REPEAT() |
yes | yes | yes | yes | ||
REPLACE() |
yes | yes | yes | yes | ||
REVERSE() |
yes | yes | yes | yes | ||
>> |
yes | yes | yes | yes | ||
RIGHT() |
yes | yes | yes | yes | ||
RLIKE |
yes | yes | yes | yes | ||
ROUND() |
yes | yes | yes | yes | ||
ROW_COUNT() |
v5.0.1 | yes | yes | yes | yes | |
RPAD() |
yes | yes | yes | yes | ||
RTRIM() |
yes | yes | yes | yes | ||
SCHEMA() |
v5.0.2 | yes | yes | yes | yes | |
SEC_TO_TIME() |
yes | yes | yes | yes | ||
SECOND() |
yes | yes | yes | yes | ||
SESSION_USER() |
yes | yes | yes | yes | ||
SHA1() , SHA()
|
yes | yes | yes | yes | ||
SHA2() |
v6.0.5 | |||||
SIGN() |
yes | yes | yes | yes | ||
SIN() |
yes | yes | yes | yes | ||
SLEEP() |
v5.0.12 | yes | yes | yes | yes | |
SOUNDEX() |
yes | yes | yes | yes | ||
SOUNDS LIKE |
v4.1.0 | yes | yes | yes | yes | |
SPACE() |
yes | yes | yes | yes | ||
SQRT() |
yes | yes | yes | yes | ||
STD() |
yes | yes | yes | yes | ||
STDDEV_POP() |
v5.0.3 | yes | yes | yes | yes | |
STDDEV_SAMP() |
v5.0.3 | yes | yes | yes | yes | |
STDDEV() |
yes | yes | yes | yes | ||
STR_TO_DATE() |
v4.1.1 | yes | yes | yes | yes | |
STRCMP() |
yes | yes | yes | yes | ||
SUBDATE() |
yes | yes | yes | yes | ||
SUBSTR() |
yes | yes | yes | yes | ||
SUBSTRING_INDEX() |
yes | yes | yes | yes | ||
SUBSTRING() |
yes | yes | yes | yes | ||
SUBTIME() |
v4.1.1 | yes | yes | yes | yes | |
SUM() |
yes | yes | yes | yes | ||
SYSDATE() |
yes | yes | yes | yes | ||
SYSTEM_USER() |
yes | yes | yes | yes | ||
TAN() |
yes | yes | yes | yes | ||
TIME_FORMAT() |
yes | yes | yes | yes | ||
TIME_TO_SEC() |
yes | yes | yes | yes | ||
TIME() |
v4.1.1 | yes | yes | yes | yes | |
TIMEDIFF() |
v4.1.1 | yes | yes | yes | yes | |
* |
yes | yes | yes | yes | ||
TIMESTAMP() |
v4.1.1 | yes | yes | yes | yes | |
TIMESTAMPADD() |
v5.0.0 | yes | yes | yes | yes | |
TIMESTAMPDIFF() |
v5.0.0 | yes | yes | yes | yes | |
TO_DAYS() |
yes | yes | yes | yes | ||
TO_SECONDS() |
v5.0.0 | yes | ||||
TRIM() |
yes | yes | yes | yes | ||
TRUNCATE() |
yes | yes | yes | yes | ||
UCASE() |
yes | yes | yes | yes | ||
- |
yes | yes | yes | yes | ||
UNCOMPRESS() |
v4.1.1 | yes | yes | yes | yes | |
UNCOMPRESSED_LENGTH() |
v4.1.1 | yes | yes | yes | yes | |
UNHEX() |
v4.1.2 | yes | yes | yes | yes | |
UNIX_TIMESTAMP() |
yes | yes | yes | yes | ||
UpdateXML() |
v5.1.5 | yes | yes | yes | ||
UPPER() |
yes | yes | yes | yes | ||
USER() |
yes | yes | yes | yes | ||
UTC_DATE() |
v4.1.1 | yes | yes | yes | yes | |
UTC_TIME() |
v4.1.1 | yes | yes | yes | yes | |
UTC_TIMESTAMP() |
v4.1.1 | yes | yes | yes | yes | |
UUID_SHORT() |
v5.1.20 | yes | yes | yes | ||
UUID() |
v4.1.2 | yes | yes | yes | yes | |
VALUES() |
v4.1.1 | yes | yes | yes | yes | |
VAR_POP() |
v5.0.3 | yes | yes | yes | yes | |
VAR_SAMP() |
v5.0.3 | yes | yes | yes | yes | |
VARIANCE() |
v4.1 | yes | yes | yes | yes | |
VERSION() |
yes | yes | yes | yes | ||
WEEK() |
yes | yes | yes | yes | ||
WEEKDAY() |
yes | yes | yes | yes | ||
WEEKOFYEAR() |
v4.1.1 | yes | yes | yes | yes | |
WEIGHT_STRING() |
v5.2.4 | |||||
XOR |
yes | yes | yes | yes | ||
YEAR() |
yes | yes | yes | yes | ||
YEARWEEK() |
yes | yes | yes | yes |