|
|
| Table Column Names | Expressions | String Expressions |
You can use these binary operators in arithmetic expressions : + for addition, - for substraction, * for multiplication, / for division, DIV for division without a remainder a MOD for modulus. You can also use the unary operator minus - for inverse value.
Arithmetic operator priority is as normal:
*,/,DIV and MOD (multiplication, division, division without a remainder and modulus) - , binary + a - (addition and substraction) Implicit conversion of expression operand types (numeric types) occurs when evaluating the expressions. Types are always converted to the next highest: TINYINT to SMALLINT to INTEGER to BIGINT to REAL.
DIV and MOD are specific to 602SQLSeveral combinations of arithmetic expressions are shown in the query:
SELECT Invoices.amount AS AMOUNT,
(CURRENT_DATE-dat1-14) AS DAY_COUNT,
(CURRENT_DATE-dat1-14)*0.01*amount AS PENALTY,
amount+(CURRENT_DATE-dat1-14)*0.01*amount AS TOTAL,
Companies.name AS NAME,
Invoices.number AS IN_NUMBER
FROM Invoices, Companies
WHERE Invoices.company=Companies.number
AND (Invoices.paid IS NULL AND
Invoices.dat1<=CURRENT_DATE-14 AND
Invoices.type=2)
| Table Column Names | Expressions | String Expressions |