MySQL DIV Function
THE WORLD'S LARGEST WEB DEVELOPER SITE

MySQL DIV Function

❮ MySQL Functions

Example

Integer division (10/5):

SELECT 10 DIV 5;
Try it Yourself »

Definition and Usage

The DIV function is used for integer division where n is divided by m. An integer value is returned.

Syntax

n DIV m

Parameter Values

Parameter Description
n Required. The value that will be divided by m
m Required. The value that will be divided into n

Technical Details

Works in: MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23

More Examples

Example

Integer division (8/3):

SELECT 8 DIV 3;
Try it Yourself »

❮ MySQL Functions