Relational Operator

A relational operator compares two expressions quantitatively. Use the Relational Operator segment whenever you see a reference to a relational operator in a syntax diagram.

Syntax

(1)
Relational Operator

1  <  
1  <=  
1  >  
2.1  =  
2.1  ==  
1  >=  
1  <>  
1 1 != 
Notes:
  • 1 HCL OneDB™ extension

Usage

The relational operators of SQL have the following meanings.

Relational Operator
Meaning
<
Less than
<=
Less than or equal to
>
Greater than
= or ==
Equal to
>=
Greater than or equal to
<> or !=
Not equal to

Usage

For number expressions, greater than means to the right on the real line.

For DATE and DATETIME expressions, greater than means later in time.

For INTERVAL expressions, greater than means a longer span of time.

For CHAR, VARCHAR, and LVARCHAR expressions, greater than means after in code-set order.

For NCHAR and NVARCHAR expressions, greater than means after in the localized collation order, if one exists; otherwise, greater than means after in code-set order.

Locale-based collation order, if one is defined for the locale, is used for NCHAR and NVARCHAR expressions. So for NCHAR and NVARCHAR expressions, greater than means after in the locale-based collation order. For more information on locale-based collation order and the NCHAR and NVARCHAR data types, see the HCL OneDB GLS User's Guide.

For information on how relational operator expressions with NCHAR and NVARCHAR operands in databases that have the NLCASE INSENSITIVE property differ from their behavior in databases that are case sensitive, see the topic NCHAR and NVARCHAR expressions in case-insensitive databases.