Arithmetic Expressions

Open SQL for Java supports the full range of arithmetic expressions defined by entry SQL level in statements.

Syntax

<arithmetic expression> ::= 
              <term> 
              | <value expression> ( '+' | '-' ) <term>.

<term> ::= <factor> | 
              <term> ( '*' | '/' ) <factor>.

<factor> ::= ( '+' | '-' )? < primary>.

< primary> ::= <column reference> 
                    | <literal> 
                    | <set function> 
                    | '(' <value expression> ')'.

            

Example

Arithmetic Expressions . For all employees that have a salary not exceeding 80% of the salary of the maximum salary of all employees, this query returns the name of the employee and the sum of its salary and its benefit.