Wednesday 13 February 2013

29. Arithmetic Operators

Arithmetic Operators

Teradata provides the following ANSI compliant arithmetic operators:

* multiply
/ divide
+ add
- subtract
+ positive value
- negative value

Teradata Extensions

Teradata supports two additional arithmetic operators that provide additional
functionality beyond ANSI SQL:

·
** (exponentiation) is used in the form: <n>**<arg>, where <n> is raised
to the power of <arg>.

Example: 4**3 = 4 * 4 * 4 = 64.

·
MOD is the modulo operator, which calculates the remainder in a division
operation.

Example: 60 MOD 7 = 4
(Since 60 divided by 7 equals 8, with a remainder of 4.)


No comments:

Post a Comment