Updated on 2024-04-28 GMT+08:00

Comparison Operators

Comparison operators can be used for all data types. The return results are Boolean values.

All comparison operators are binary operators. Only data types that are the same or can be implicitly converted can be compared using comparison operators. Expressions such as "1<2<3" are invalid because Boolean values cannot be compared with 3.

Table 1 describes comparison operators provided by GaussDB(DWS).

Table 1 Comparison operators

Operators

Description

<

Less than

>

Greater than

<=

Less than or equal to

>=

Greater than or equal to

=

Equality

<> or !=

Inequality