For the complete documentation index, see llms.txt. This page is also available as Markdown.

Arithmetic Operators

Learn about arithmetic operators in MariaDB Server SQL. This section details how to perform mathematical calculations like addition, subtraction, multiplication, and division within your queries.

Add two operands with the + operator, calculating integer results at BIGINT precision and letting the highest-precision operand determine the result type for real or string values.

Subtract one operand from another with the - operator, which also serves as the unary minus for changing sign, computing integer results at BIGINT precision.

Multiply two operands with the * operator.

Divide operands with the / operator, returning NULL on division by zero and controlling decimal digits with the div_precision_increment system variable.

Return the remainder of N divided by M with the % modulo operator.

Last updated

Was this helpful?