MOD()
MOD() is a SQL function in the Numeric Functions category. Returns the remainder of a division operation. The syntax is MOD(dividend, divisor). It accepts dividend, divisor. It returns integer remainder. A typical example: SELECT MOD(10, 3); -- 1 SELECT * FROM employees WHERE MOD(id, 2) = 0; -- Even IDs A close relative is ROUND(), which rounds a number to a specified number of decimal places. A close relative is ABS(), which returns the absolute (positive) value of a number. A close relative is CEIL() / CEILING(), which returns the smallest integer greater than or equal to a number (rounds up). More about this category: Mathematical functions — ROUND, ABS, CEIL, FLOOR, POWER, SQRT, MOD. Related Numeric Functions entries: ROUND(), ABS(), CEIL() / CEILING(), FLOOR(), POWER() / POW(), SQRT(), GREATEST() / LEAST(), RAND() / RANDOM(). This page is part of the free SQL Reference documentation covering 762+ statements, functions, and clauses, each with syntax, parameters, return values, and examples for MySQL, PostgreSQL, SQL Server, and SQLite.