MySQL Wildcards

MySQL Wildcards

MySQL Aliases

MySQL Aliases

MySQL Data Types

MySQL Data Types

MySQL Interview Questions

MySQL Interview Questions and Answers


MySQL Div Operator

In MySQL div operator is used to perform integer division. The MySQL DIV operator will return integer value.

Note: The DIV operator can be used with BIGINT values.

MySQL DIV OPERATOR Syntax

To perform integer division, use the following syntax:

Syntax

SELECT n DIV m, h DIV -u;

MySQL DIV OPERATOR example

The following MySQL, DIV operator is used to perform integer division:

Example

SELECT 5 DIV 2, 5 DIV -2;

Note:

In the above example, we are performing integer division operation with the help of DIV operator.

You can use MySQL Command Line Client to perform integer division operation. It will look like this: