Топ-100
 
CerebroSQL

DIV

Database: MySQL

68747470733a2f2f7374796c65732e7265646469746d656469612e636f6d2f74355f32716d366b2f7374796c65

Topic

Syntax:
DIV

Integer division. Discards from the division result any fractional part
to the right of the decimal point.

If either operand has a noninteger type, the operands are converted to
DECIMAL and divided using DECIMAL arithmetic before converting the
result to BIGINT. If the result exceeds BIGINT range, an error occurs.

Example

mysql> SELECT 5 DIV 2, -5 DIV 2, 5 DIV -2, -5 DIV -2;
-> 2, -2, -2, 2