ABS
Syntax
ABS(numeric value)
Description
ABS returns the absolute value of the
numeric argument. The numeric argument may be of any integral,
exact numeric or approximate numeric type, and the result will
be of the same type.
ASCII
Syntax
ASCII(character string)
Description
ASCII returns the integer ASCII code value
of the first character in the string.
ACOS
Syntax
ACOS(numeric value)
Description
ACOSreturns the arc cosine of an angle
expressed in radians.
ASIN
Syntax
ASIN(numeric value)
Description
ASINreturns the arc sine of an angle
expressed in radians.
ATAN
Syntax
ATAN(numeric value)
Description
ATANreturns the arc tangent of an angle
expressed in radians.
ATAN2
Syntax
ATAN2(y, x)
Description
ATAN2converts the specified rectangular
coordinates to polar and returns the theta component of the
point (r, theta) in polar coordianate space
that correspondes to the point (x, y) in
rectangular space.
BIT_LENGTH
Syntax
BIT_LENGTH(character or bit string)
Description
BIT_LENGTH returns the length of the string
argument in bits.
CASE
Syntax
CASE ( WHEN condition THEN value )*
( ELSE else-value )?
END
Description
The value of the CASE expression is the
value of the 'THEN value' clause
for the first 'WHEN condition' which
evaluates to TRUE.
If none of the WHEN clauses evaluate to
true, the value returned is that of the 'ELSE
else-value' clause, or NULL.
CAST
Syntax
CAST expression AS datatype
Description
Converts expression to datatype, where
datatype is one of the following types:
- INT OR INTEGER
- SMALLINT
- TINYINT
- BIGINT
- VARCHAR
- CHAR
- DECIMAL
- DEC
- NUMERIC
- REAL
- DOUBLE
- FLOAT
- BOOLEAN
- BIT
- BINARY
- BIT VARYING
- VARBINARY
- BLOB
- BINARY LARGE OBJECT
- DATE
- TIME
- TIMESTAMP
- INTERVAL
CEILING
Syntax
CEILING(numeric value)
Description
CEILINGreturns the least integer which is
greater or equal to the specified numeric value.
CHAR
Syntax
CHAR(ascii code value)
Description
CHARreturns a string of length one, containing
the character represented by the specified ASCII code value,
as an integer in the range 0-255.
CHARACTER_LENGTH
Syntax
CHAR_LENGTH(character or bit string)
CHARACTER_LENGTH(character or bit string)
Description
If the argument is a character string,
CHAR_LENGTH and
CHARACTER_LENGTH
return the length of the string argument in characters,
otherwise,
they return the number of octets in the argument.
COS
Syntax
COS(numeric value)
Description
COSreturns the cosine of an angle
expressed in radians.
COALESCE
Syntax
COS(expression, ...)
Description
COALESCEreturns the first non-null value in
the expression list, or NULL if all values in the list are
NULL.
COT
Syntax
COT(numeric value)
Description
COTreturns the cotangent of an angle
expressed in radians.
CONCAT
Syntax
CONCAT(string1, string2)
Description
CONCAT returns a string formed by concatenating
string1 with string2.
CURDATE
Syntax
CURDATE()
Description
CURDATE returns the current date as a
DATE value.
CURTIME
Syntax
CURTIME()
Description
CURTIME returns the current local time as a
TIME value.
DATABASE
Syntax
DATABASE()
Description
DATABASE returns the URL of the current
database.
DAYNAME
Syntax
DAYNAME(date)
Description
DAYNAME returns the a string representing
the day component of date.
DAYOFMONTH
Syntax
DAYOFMONTH(date)
Description
DAYOFMONTH returns an integer in the range
1-31 representing the day of the month in date.
DAYOFWEEK
Syntax
DAYOFWEEK(date)
Description
DAYOFWEEK returns an integer in the range
1-7 representing the day of the week in date,
where '1' represents Sunday.
DAYOFYEAR
Syntax
DAYOFYEAR(date)
Description
DAYOFYEAR returns an integer in the range
1-366 representing the day of the year in date.
DEGREES
Syntax
DEGREES(numeric value)
Description
DEGREESconverts radians to degrees
DIFFERENCE
Syntax
DIFFERENCE(string1, string2)
Description
DIFFERENCE returns difference between the
soundex functions of the two arguments. It does so by
comparing the two soundex codes character by character
and returning the count of identical characters. Higher
values therefore indicate a closer match.
EXP
Syntax
EXP(numeric value)
Description
EXPreturns the exponential value, i.e.
e raised to the power of the argument.
FLOOR
Syntax
FLOOR(numeric value)
Description
FLOORreturns the greatest integer which is
less or equal to the specified numeric value.
HOUR
Syntax
HOUR(time)
Description
HOUR returns an integer in the range
0-23 representing the hour component of the specified
time value
IFNULL
Syntax
IFNULL(expression, value)
Description
IFNULL returns expression, unless
expression is NULL, in which case
it returns value.
INSERT
Syntax
INSERT(string1, start,
length, string2)
Description
INSERT returns a new string formed by deleting
length characters from string1 starting at
start, and inserting string2 into string1
at start.
LEFT
Syntax
LEFT(string, count)
Description
LEFT returns a new string consisting of
the count leftmost characters of string.
LENGTH
Syntax
LENGTH(string)
Description
LENGTH returns the number of characters
in string, not counting trailing spaces.
LOCATE
Syntax
LOCATE(string1, string2[, start])
Description
LOCATE returns the position of the first
occurrence of string1 in string2. Searching
begins with the first character of string2, unless
start is specified, in which case searching begins with
the character specified by start. 0 is returned if
the search string is not found. The position of the first
character of the 1.
LOG
Syntax
LOG(numeric value)
Description
LOGreturns the base e logarithm
of the argument.
LOG10
Syntax
LOG10(numeric value)
Description
LOGreturns the base 10 logarithm
of the argument.
LOWER
Syntax
LOWER(character string)
LCASE(character string)
Description
LOWER and LCASE return a string with
each upper-case letter in
the string argument replaced by its corresponding lower-case
letter.
LTRIM
Syntax
LTRIM(string)
Description
LTRIM removes leading whitespace from
string.
MINUTE
Syntax
MINUTE(time)
Description
MINUTE returns an integer in the range
0-59 representing the minute component of the specified
time value
MOD
Syntax
MOD(integer1, integer2)
Description
MOD returns the remainder from the
division integer1/integer2.
MONTH
Syntax
MONTH(date)
Description
MONTH returns an integer in the range
1-12 representing the month in date.
MONTHNAME
Syntax
MONTHNAME(date)
Description
MONTHNAME returns the a string representing
the month component of date.
NOW
Syntax
NOW()
Description
NOW returns the current date and time as a
TIMESTAMP value.
NULLIF
Syntax
NULLIF(value1, value2)
Description
NULLIF returns NULL if
value1 is equal to value2, otherwise
it returns value1.
OCTET_LENGTH
Syntax
OCTET_LENGTH(character or bit string)
Description
OCTET_LENGTH returns the length of the string
argument in octets.
PI
Syntax
PI()
Description
PI returns the constant pi as a
DOUBLEd PRECISION value.
POWER
Syntax
POWER(number1, number2)
Description
POWER returns the number1 raised to
the number2 power.
QUARTER
Syntax
QUARTER(time)
Description
QUARTER returns an integer in the range
1-4 representing the quarter (i.e. three-month period)
component of the date value.
RADIANS
Syntax
RADIANS(numeric value)
Description
RADIANSconverts degrees to radians.
RAND
Syntax
RAND([seed])
Description
RAND returns a pseudo-random, uniformly
distributed number between 0 and 1. If seed is
specified, the random number generator is first seeded with
the seed value. Each Connection has its
own random number generator.
REPEAT
Syntax
REPEAT(string, number)
Description
REPEAT returns a string formed by concatenating
number occurrences of string.
REPLACE
Syntax
REPLACE(string1, string2, string3)
Description
REPLACE returns a string formed by replacing
all occurrences of string2 in string1 with
string3.
RIGHT
Syntax
RIGHT(string, count)
Description
RIGHT returns a new string consisting of
the count rightmost characters of string.
ROUND
Syntax
ROUND(number, scale)
Description
ROUND returns number, with the
number of digits to the right of the decimal point rounded
to scale places.
RTRIM
Syntax
RTRIM(string)
Description
RTRIM removes trailing whitespace from
string.
SECOND
Syntax
SECOND(time)
Description
SECOND returns an integer in the range
0-59 representing the second component of the specified
time value.
SIGN
Syntax
SIGN(numeric value)
Description
SINreturns -1, 0, or 1 to indicates that the
number is respectively, negative, zero, or positive.
SIN
Syntax
SIN(numeric value)
Description
SINreturns the sine of an angle
expressed in radians.
SOUNDEX
Syntax
SOUNDEX(character string)
Description
SOUNDEX returns the four character SOUNDEX
code corresponding to the string argument.
SPACE
Syntax
SPACE(number)
Description
SPACE returns a string consisting of
number spaces.
SQRT
Syntax
SQRT(number)
Description
SQRTreturns square root of number.
SUBSTRING
Syntax
SUBSTRING(string1, start, length)
Description
SUBSTRING returns a string consisting
of the characters from string starting with the
character at position start and for length
characters. The first character in the source string
is a position 1.
TAN
Syntax
TAN(numeric value)
Description
TANreturns the tangent of an angle expressed
in radians.
TIMESTAMPADD
Syntax
TIMESTAMPADD(interval, count,
timestamp)
Description
TIMESTAMPADDreturns the timestamp resulting
from adding count of type interval to
timestamp.
interval is one of the following keywords:
- SQL_TSI_FRAC_SECOND
- SQL_TSI_SECOND
- SQL_TSI_MINUTE
- SQL_TSI_HOUR
- SQL_TSI_DAY
- SQL_TSI_WEEK
- SQL_TSI_MONTH
- SQL_TSI_QUARTER
- SQL_TSI_YEAR
TIMESTAMPDIFF
Syntax
TIMESTAMPDIFF(interval, timestamp1,
timestamp2)
Description
TIMESTAMPDIFFreturns the the difference between
timestamp2 and timestamp1, expressed in
interval units.
interval is one of the following keywords:
- SQL_TSI_FRAC_SECOND
- SQL_TSI_SECOND
- SQL_TSI_MINUTE
- SQL_TSI_HOUR
- SQL_TSI_DAY
- SQL_TSI_WEEK
- SQL_TSI_MONTH
- SQL_TSI_QUARTER
- SQL_TSI_YEAR
TRUNCATE
Syntax
TRUNCATE(number, scale)
Description
TRUNCATE returns number, with the
number of digits to the right of the decimal point truncated
to scale places.
UPPER
Syntax
UPPER(character string)
UCASE(character string)
Description
UPPER and UCASE return a string with each
lower-case letter in the string argument replaced by
its corresponding upper-case letter.
USER
Syntax
USER()
Description
USER returns the name of the current
database user.
WEEK
Syntax
WEEK(date)
Description
WEEK returns an integer in the range
1-53 representing the week in date.
YEAR
Syntax
YEAR(date)
Description
YEAR returns an integer
representing the year component of date.
LAST_INSERT_ID
Syntax
LAST_INSERT_ID()
Description
LAST_INSERT_ID returns the id of the last
auto-numbered (i.e., resulting from a WITH IDENTITY
constraint) row insertion.