SUB
Description
The subtraction operator computes the difference of two values.
The subtraction operator can be applied to INT or FLOAT columns or constants. The resulting column is of type INT if both input columns or constants are of type INT. In all other cases, the resulting column is of type FLOAT.
Syntax
SUB ( table.column1 , table.column2 )
table.column1 - table.column2
NULL handling
If one of the input values is NULL, the result is NULL as well.
Examples
[1] | ||||||||||||||
| ||||||||||||||
|
[2] Subtract a constant FLOAT value from a column of type FLOAT: | ||||||||||||||
| ||||||||||||||
|
[3] | ||||||||||||||
| ||||||||||||||
|
[4] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|