The following table compares the built-in functions used in MaxCompute with those of MySQL and Oracle.

Function type MaxCompute MySQL Oracle
Date functions DATEDIFF DATEDIFF MONTHS_BETWEEN
DATEADD DATE_ADD N/A
DATEPART DATE_FORMAT EXTRACT (datetime)
DATETRUNC DATE_FORMAT EXTRACT (datetime)
FROM_UNIXTIME FROM_UNIXTIME N/A
GETDATE NOW CURRENT_DATE
ISDATE STR_TO_DATE (If 'false' is returned, the string cannot be converted to date.) N/A
LASTDAY LAST_DAY LAST_DAY
TO_DATE STR_TO_DATE() DATE
TO_CHAR DATE_FORMAT TO_CHAR (datetime)
UNIX_TIMESTAMP UNIX_TIMESTAMP N/A
WEEKDAY WEEKDAY N/A
WEEKOFYEAR WEEKOFYEAR N/A
YEAR YEAR YEAR
QUARTER QUARTER QUARTER
MONTH MONTH MONTH
DAY DAY DAY
DAYOFMONTH DAYOFMONTH N/A
HOUR HOUR HOUR
MINUTE MINUTE MINUTE
CURRENT_TIMESTAMP CURRENT_TIMESTAMP CURRENT_TIMESTAMP
ADD_MONTHS ADDDATE ADD_MONTHS
LAST_DAY LAST_DAY N/A
NEXT_DAY N/ NEXT_DAY
MONTHS_BETWEEN timestampdiff MONTHS_BETWEEN
Mathematical functions ABS ABS ABS
ACOS ACOS ACOS
ASIN ASIN ASIN
ATAN ATAN ATAN
CEIL CEIL CEIL
CONV CONV N/A
COS COS COS
COSH N/A COSH
COT COT COT
EXP EXP EXP
FLOOR FLOOR FLOOR
LN LN LN
LOG LOG LOG
POW POW POWER
RAND RAND N/A
ROUND ROUND ROUND
SIN SIN SIN
SINH N/A SINH
SQRT SQRT SQRT
TAN TAN TAN
TANH N/A TANH
TRUNC TRUNCATE TRUNC
LOG2 LOG2 LOG
LOG10 LOG10 LOG
BIN BIN BITAND
HEX HEX RAWTOHEX
UNHEX UNHEX HEXTORAW
RADIANS RADIANS RADIANS
DEGREES DEGREES DEGREES
SIGN SIGN SIGN
E N/A EXP
PI PI PI
FACTORIAL N/A N/A
CBRT N/A N/A
SHIFTLEFT << N/A
SHIFTRIGHT >> N/A
SHIFTRIGHTUNSIGNED >>> N/A
Window functions DENSE_RANK DENSE_RANK DENSE_RANK
RANK RANK RANK
LAG LAG LAG
LEAD LEAD LEAD
PERCENT_RANK PERCENT_RANK PERCENT_RANK
ROW_NUMBER ROW_NUMBER ROW_NUMBER
CLUSTER_SAMPLE N/A N/A
NTILE NTILE NTILE
Aggregate functions COUNT COUNT COUNT
AVG AVG AVG
MAX MAX MAX
MIN MIN MIN
MEDIAN N/A MEDIAN
STDDEV STDDEV STDDEV
STDDEV_SAMP STDDEV_SAMP STDDEV_SAMP
SUM SUM SUM
WM_CONCAT GROUP_CONCAT WM_CONCAT
COLLECT_LIST N/A COLLECT
COLLECT_SET N/A COLLECT
VARIANCE/VAR_POP VAR_POP VARIANCE/VAR_POP
VAR_SAMP VAR_SAMP VAR_SAMP
COVAR_POP N/A COVAR_POP
COVAR_SAMP N/A COVAR_SAMP
PERCENTILE N/A N/A
String functions CHAR_MATCHCOUNT N/A N/A
CHR CHAR CHR
CONCAT CONCAT CONCAT
GET_JSON_OBJECT JSON_EXTRACT() N/A
INSTR INSTR INSTR
IS_ENCODING N/A N/A
KEYVALUE N/A N/A
LENGTH LENGTH LENGTH
LENGTHB LENGTHB LENGTHB
MD5 MD5 N/A
REGEXP_EXTRACT N/A N/A
REGEXP_INSTR REGEXP_INSTR REGEXP_INSTR
REGEXP_REPLACE REGEXP_REPLACE REGEXP_REPLACE
REGEXP_SUBSTR REGEXP_SUBSTR REGEXP_SUBSTR
REGEXP_COUNT N/A REGEXP_COUNT
SPLIT_PART N/A N/A
SUBSTR SUBSTR SUBSTR
SUBSTRING SUBSTRING SUBSTR
TOLOWER LOWER LOWER
TOUPPER UPPER UPPER
TO_CHAR DATE_FORMAT TO_CHAR
TRIM TRIM TRIM
LTRIM LTRIM LTRIM
RTRIM RTRIM LTRIM
REVERSE REVERSE REVERSE
SPACE SPACE SPACE
REPEAT REPEAT REPEAT
ASCII ASCII ASCII
CONCAT_WS CONCAT_WS N/A
LPAD LPAD LPAD
RPAD RPAD RPAD
REPLACE REPLACE REPLACE
SOUNDEX SOUNDEX SOUNDEX
SUBSTRING_INDEX SUBSTRING_INDEX N/A
TRANSLATE N/A TRANSLATE
URL_DECODE N/A N/A
URL_ENCODE N/A PERCENTILE_CONT
CRC32 CRC32 N/A
Other functions CAST CAST CAST
COALESCE COALESCE COALESCE
DECODE N/A DECODE
GET_IDCARD_AGE N/A N/A
GET_IDCARD_BIRTHDAY N/A N/A
GET_IDCARD_SEX N/A N/A
GREATEST GREATEST N/A
ORDINAL N/A GREATEST
LEAST LEAST N/A
MAX_PT N/A LEAST
UUID UUID N/A
SAMPLE N/A UID
IF IF IF
CASE WHEN CASE WHEN CASE WHEN
SPLIT SPLIT N/A
STR_TO_MAP N/A N/A
EXPLODE N/A N/A
MAP N/A N/A
MAP_KEYS N/A N/A
MAP_VALUES N/A N/A
NVL IFNULL N/A
ARRAY N/A N/A
SIZE N/A N/A
ARRAY_CONTAINS N/A N/A
POSEXPLODE N/A N/A
TRANS_ARRAY N/A N/A
INLINE N/A N/A
NAMED_STRUCT N/A N/A