Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

MySQL DIV OPERATOR

DIV OPERATOR

MySQL div operator is used for integer division.

Syntax:

expression DIV num 

Arguments:

Name Description
expression An expression which contains the dividend.
num Divisor.

Pictorial presentation of MySQL DIV() operator

pictorial presentation of MySQL DIV() function

Example of MySQL DIV() OPERATORS

Code:

SELECT 12 DIV 3;

Explanation:

The above MySQL statement divides 12 by 3.

Sample Output:

mysql> SELECT 12 DIV 3;
+----------+
| 12 DIV 3 |
+----------+
|        4 | 
+----------+
1 row in set (0.02 sec)

All Mathematical Functions

MySQL Mathematical Functions, slide presentation

Previous: DEGREES()
Next: DIVISION