-

Description

Unary minus. This operator changes the sign of the operand.

Syntax

1. > SELECT -column1, -column2, ...
2. FROM table_name;

Examples

1. mysql> select -2;
2. +------+
3. | -2   |
4. +------+
5. |   -2 |
6. +------+
1. create table t2(c1 int, c2 int);
2. insert into t2 values (-3, 2);
3. insert into t2 values (1, 2);

5. mysql> select -c1 from t2;
6. +------+
7. | -c1  |
8. +------+
9. |    3 |
10. |   -1 |
11. +------+
12. 2 rows in set (0.00 sec)