IBM PureData System for Analytics, Version 7.1

Operators

Operators differ from functions in the following ways:
  • Operators are symbols not names.
  • Operators usually take two arguments.
  • Arguments usually display to the left and right of the operator symbol.

The standard arithmetic operators (addition, subtraction, multiplication, division, exponentiation, and modulo) use the standard precedence rules. That is, exponentiation runs first; multiplication, division, and modulo second; and addition and subtraction last. You can use parentheses to alter this precedence. IBM® Netezza® SQL evaluates operators of the same precedence in a left-to-right manner unless you use parentheses.

The following table describes the Netezza SQL operators.

Table 1. Operators
Operator Symbol
Binary arithmetic operators  
Addition +
Subtraction -
Multiplication *
Division /
Exponentiation ^ or **
Modulo %
Unary arithmetic operators  
Plus +
Minus -
Factorial !
Binary text operator  
Concatenate ||
Relational operators  
Equal =
Not equal <> or !=
Greater than >
Greater than or equal >=
Less than <
Less than or equal <=
Netezza follows Postgres operator precedence rules. The following table lists the precedence and associativity of the available operators.
Table 2. Operator precedence
Operator/Element Associativity Description
. Left Table/column name separator
:: Left Typecast (PostgreSQL extension to standard SQL)
- Right Unary minus
^ Left Exponentiation
* / % Left Multiplication, division, modulo
+ – Left Addition, subtraction
IS   IS TRUE, IS FALSE, IS UNKNOWN, IS NULL, IS NOT NULL
ISNULL   Test for null (PostgreSQL extension to standard SQL)
NOTNULL   Test for not null (PostgreSQL extension to standard SQL.)
(any other) Left All other native operators
IN   Set membership
BETWEEN   Containment
OVERLAPS   Time interval overlap
LIKE   String pattern matching
< <= > >=   Less than, less than or equal to, greater than, greater than or equal to
= Right Equality, assignment
NOT Right Logical negation
AND Left Logical conjunction
OR Left Logical disjunction


Feedback | Copyright IBM Corporation 2014 | Last updated: 2014-02-28