bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL DIV Function

Concept visual

MySQL DIV Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Integer division (10/5):

SELECT 10 DIV 5;

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;

Previous

❮ MySQL Functions

Next

Previous

MySQL DEGREES() Function

Next

MySQL EXP() Function