Arithmetic operators

Arithmetic operators are used for numerical attributes. For example, there is the possibility to calculate the mean or the sum of attribute values from a series of objects. The following operators can be used as arithmetic operators: Multiplication (*), division (/), addition (+) and subtraction (‐) as well as the exponent operator (exp) and modulo operator (%).

Arithmetic operators
+
-
*
/
exp
%


The first five operators are self‐explanatory. The modulo operation gives the remainder from integer division. For example:
5 % 2 = 1
6 % 2 = 0

An example – arithmetic operators

INPUT

GraphicGraphic

Table ''Parcels: tree species (Baumart), stock (Vorrat), and soil type (Bodentyp)''Table ''Parcels: tree species (Baumart), stock (Vorrat), and soil type (Bodentyp)''

QUERY AND RESULT

SQL operator Result
SELECT Baumart, Vorrat, Bodentyp, Vorrat*2/100 as Holznutzung
FROM Parzelle
WHERE Vorrat > 120;