skip to main content
Supported SQL Statements and Extensions : SQL Expressions : Operators : Arithmetic Operators
  

Try DataDirect Drivers Now
Arithmetic Operators
You can use an arithmetic operator in an expression to negate, add, subtract, multiply, and divide numeric values. The result of this operation is also a numeric value. The + and - operators are also supported in date/time fields to allow date arithmetic. The following table lists the supported arithmetic operators.
Table 23. Arithmetic Operators
Operator
Purpose
Example
+ -
Denotes a positive or negative expression. These are unary operators.
SELECT * FROM emp WHERE comm = -1
* /
Multiplies, divides. These are binary operators.
UPDATE emp SET sal = sal + sal * 0.10
+ -
Adds, subtracts. These are binary operators.
SELECT sal + comm FROM emp WHERE empno > 100