MySQL DIV Function

Example

Integer division (10/5):

SELECT 10 DIV 5;
Try it Yourself »

Definition and Usage

The DIV function is used for integer division (x is divided by y). An integer value is returned.

Syntax

x DIV y

Parameter Values

Parameter Description
x Required. A value that will be divided by y
y Required. The divisor

Technical Details

Works in: From MySQL 4.0

More Examples

Example

Integer division (8/3):

SELECT 8 DIV 3;
Try it Yourself »

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.