Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

Numeric Arithmetic Expressions

Description

Numeric arithmetic expressions compute a value using addition, subtraction, multiplication, and division operations on numeric literals and expressions that evaluate to any numeric data type.

Syntax

numeric-arith-expr ::

[ + | - ] { numeric-literal | numeric-expr } [ { + | - | * | / } numeric-arith-expr ]

Arguments

[ + | - ]

Unary plus or minus operator

numeric-literal

A numeric literal. Refer to Numeric Literals for details on specifying numeric literals.

numeric-expr
Any expression that evaluates to a numeric data type (Refer to Data Types for details of numeric data types), including:

  • Column names
  • Subqueries that return a single value
  • Aggregate functions
  • CAST or CONVERT operations to numeric data types
  • Other scalar functions that return a numeric data type

{ + | - | * | \ }
Addition, subtraction, multiplication, or division operator. FairCom DB SQL evaluates numeric arithmetic expressions in the following order:

  • Unary plus or minus
  • Expressions in parentheses
  • Multiplication and division, from left to right
  • Addition and subtraction, from left to right

TOCIndex