Show TOC Start of Content Area

This graphic is explained in the accompanying text Arithmetic Expressions  Locate the document in its SAP Library structure

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

Syntax

This graphic is explained in the accompanying text

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

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

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

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

Example

This graphic is explained in the accompanying text

SELECT employee_name, salary + benefit
               FROM employees
               WHERE salary < 0.8 *
                  ( SELECT MAX( salary ) FROM employees )

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.

More Information

Column References

Literals

Set Functions

Value expressions

End of Content Area