General Functions
General functions operate on one or more discrete values. We have omitted a few rarely used functions with very specialized applications.
-
ABS(number) Returns the absolute value of
number(e.g.,ABS(-10)returns 10).-
ACOS(number) Returns the inverse cosine of
numberin radians (e.g.,ACOS(0)returns 1.570796).-
ADDDATE(date,INTERVALamounttype) Synonym for
DATE_ADD.-
ASCII(char) Returns the ASCII value of the given character (e.g.,
ASCII('h')returns 104).-
ASIN(number) Returns the inverse sine of
numberin radians (e.g.,ASIN(0)returns 0.000000).-
ATAN(number) Returns the inverse tangent of number in radians (e.g.,
ATAN(1)returns 0.785398).-
ATAN2(X, Y) Returns the inverse tangent of the point
(X,Y)(for example,ATAN(-3,3)returns -0.785398).-
BENCHMARK(num,function) Runs
functionover and overnumtimes and reports the total elapsed clock time.-
BIN(decimal) Returns the binary value of the given decimal number (e.g.,
BIN(8)returns 1000). This is equivalent to the functionCONV(decimal,10,2).-
BIT_COUNT(number) Returns the number of bits that are set to 1 in the binary representation of the number (e.g.,
BIT_COUNT(17)returns 2).-
BIT_LENGTH(string) Returns the number of bits in
string(the number of characters times 8, for single-byte characters).-
CASEvalueWHENchoiceTHENreturnvalue... ELSEreturnvalueEND Compares
valueto a series ofchoicevalues or expressions. The firstchoiceto match thevalueends ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access