-
This page is part of MariaDB's Documentation.
The parent of this page is: SQL Operators for MariaDB Xpand
Topics on this page:
Overview
Subtraction.
USAGE
number1 - number2
- number
Value Name | Description |
---|---|
| Two numbers to subtract or one number to negate |
DETAILS
The -
operator returns the result of subtracting the second number from the first number.
If the number before the dash is not provided, the numeric value is negated.
A NULL
is returned if either number is NULL
.
EXAMPLES
SELECT 59 - 17, - 99;
+---------+-----+
| 59 - 17 | -99 |
+---------+-----+
| 42 | -99 |
+---------+-----+