Arithmetic operators  Logical operators

Chapter 1: Overview

Comparison operators

Comparison operators are grouped from left to right. They return zero (0) if the relation between the expressions is false, and return one (1) if it is true. When a statement contains more than one comparison operator, the operations are performed in their order of precedence. See “Operator order of precedence” for information about the precedence of the comparison operators. Use parentheses ( ) to perform operations in non-precedence order. In the examples below, “a” and “b” are character data.

Table 1-4: Comparison operators

Operator

Description

Example

==

Equality

a == b ...

!=

Inequality

a != b ...

<

Less than

a < b ...

>

Greater than

a > b ...

<=

Less than or equal

a <= b ...

>=

Greater than or equal

a >= b ...





Copyright © 2005. Sybase Inc. All rights reserved. Logical operators

View this book as PDF