Parentheses (...) Compare functions and operators
=
Equals
<=>
The null value is secure equal to
<>
Or!=
<=
And>
expr BETWEEN min AND max
COALESCE(value,...)
Returns the first non-null value in a later argument list
GREATEST(value,...)
In the subsequent argument list, return the maximum value
expr IN (value1,value2,...)
If expr exists in a later argument list, returns 1, otherwise 0
logical operators
Process Control Statements
IF(expr1,expr2,expr3)
Returns EXPR2 if Expr1 is true (expr1<>0&&expr1<>null), otherwise returns EXPR3
IFNULL(expr1,expr2)
Returns EXPR1 if EXPR1 is not NULL, otherwise returns EXPR2
String functions
ASCII(str)
, returns the value of the leftmost character
CHAR_LENGTH(str)
Equivalent to CHARACTER_LENGTH(str)
, returns the string str length (in characters). Note The LENGTH(str)
difference, which returns the string str length, but the unit is in bytes
CONCAT(str1,str2,...)
Stitching function
INSTR(str,substr)
Returns the location of the first occurrence of substr in Str
LOWER(str)
numeric operators and functions
+
/-
/*
//
ABS(X)
Absolute
ACOS(X)
FLOOR(X)
Returns an integer value that is not greater than X
Date and Time functions
ADDDATE(date,INTERVAL expr type)
ADDTIME(expr1,expr2)
CONVERT_TZ(dt,from_tz,to_tz)
Convert time zone
DATEDIFF(expr,expr2)
Time difference Value
DATE_ADD(date,INTERVAL expr type),DATE_SUB(date,INTERVAL expr type)
MySQL Functions and operators