Jump to: navigation, search

Mysql operator UNARY MENUS

From w3cyberlearnings

Contents

MySQL Unary Minus Function

This operator changes the sign of the operand.

Syntax Unary Minus

N is a number

-N

Example 1

mysql> SELECT -4;
+----+
| -4 |
+----+
| -4 | 
+----+
1 row in set (0.00 sec)

mysql> SELECT -4 * 3;
+--------+
| -4 * 3 |
+--------+
|    -12 | 
+--------+
1 row in set (0.00 sec)

Related Links

# Function Description
1 DIV Integer division
2 / Division operator
3 - Minus operator
4 % or MOD Modulo operator
5 + Addition operator
6 * Multiplication operator
7 - Change the sign of the argument
Navigation
Web
SQL
MISC
References