Chapter 6 SQL Language Elements
227
expression – expression Subtraction. If either expression is the NULL
value, the result is the NULL value.
–expression Negation. If the expression is the NULL value, the result is
the NULL value.
expression * expression Multiplication. If either expression is the
NULL value, the result is the NULL value.
expression / expression Division. If either expression is the NULL
value or if the second expression is 0, the result is the NULL value.
expression % expression Modulo finds the integer remainder after a
division involving two whole numbers. For example, 21 % 11 = 10 because
21 divided by 11 equals 1 with a remainder of 10.
String operators
expression || expression String concatenation (two vertical bars). If
either string is the NULL value, it is treated as the empty string for
concatenation.
expression + expression Alternative string concatenation. When using
the + concatenation operator, you must ensure the operands are explicitly set
to character data types rather than relying on implicit data conversion.
♦
SQL/92 The || operator is the SQL/92 string concatenation operator.
♦
Sybase The + operator is supported by Adaptive Server Enterprise.
Bitwise operators
The following operators can be used on bit data types, in both Adaptive
Server Anywhere and Adaptive Server Enterprise.
Operator Description
&and
|or
^ exclusive or
~ not
Standards and
compatibility