MariaDB: DIV Function
This MariaDB tutorial explains how to use the MariaDB DIV function with syntax and examples.
Description
The MariaDB DIV function is used for integer division where n is divided by m and an integer value is returned.
Syntax
The syntax for the DIV function in MariaDB is:
n DIV m
Parameters or Arguments
- n
- The value that will be divided by m.
- m
- The value that will be divided into n.
Note
- The DIV function will return the result as an integer value.
- The DIV function can be used with BIGINT values.
- See also the FLOOR function.
Applies To
The DIV function can be used in the following versions of MariaDB:
- MariaDB 10
Example
Let's look at some MariaDB DIV function examples and explore how to use the DIV function in MariaDB.
For example:
SELECT 7 DIV 3; Result: 2 SELECT 12 DIV 4; Result: 3 SELECT 12.6 DIV 3.4; Result: 3 SELECT 18.4 DIV -2.5; Result: -7
Advertisements