divide
Description
Returns the quotient of x
divided y
. If y
is 0, this functions returns null.
Syntax
divide(x, y)
Parameters
-
x
: The supported types are DOUBLE, FLOAT, LARGEINT, BIGINT, INT, SMALLINT, TINYINT, DECIMALV2, DECIMAL32, DECIMAL64, DECIMAL128. -
y
: The supported types are the same asx
.
Return value
Returns a value of the DOUBLE data type.
Usage notes
If you specify a non-numeric value, this function returns NULL
.
Examples
mysql> select divide(3, 2);
+--------------+
| divide(3, 2) |
+--------------+
| 1.5 |
+--------------+
1 row in set (0.00 sec)