Arithmetic expressions
An arithmetic expression contains
at least one of the arithmetic operators listed in the following table
and produces a number.
- Operator
- Operation
- +
- addition
- -
- subtraction
- *
- multiplication
- /
- division
You cannot use TEXT or BYTE columns in arithmetic expressions.
With , you cannot specify BLOB or CLOB in arithmetic expressions.
Arithmetic
operations enable you to see the results of proposed computations
without actually altering the data in the database. You can add an
INTO TEMP clause to save the altered data in a temporary table for
further reference, computations, or impromptu reports. The following
query calculates a 7 percent sales tax on the unit_price column
when the unit_price is $400 or more (but does not update it
in the database).
The result appears in the expression column.
The following query calculates a surcharge of $6.50 on
orders when the quantity ordered is less than 5.
The result appears in the expression column.
The following query calculates and displays in the expression column
the interval between when the customer call was received (call_dtime)
and when the call was resolved (res_dtime), in days, hours,
and minutes.