Comparison Operator Syntax | Teradata Vantage - 17.10 - Comparison Operator Syntax - Advanced SQL Engine - Teradata Database

Teradata Vantageâ„¢ - SQL Functions, Expressions, and Predicates

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)
{ expression_1 operator expression_2 |
  expression_1 operator quantifier ( literal [,...] ) |
  expression_1 operator [ quantifier ] ( subquery ) |
  ( expression_1 [,...] ) operator [ quantifier ] ( subquery )

Syntax Elements

An SQL scalar expression, including derived period expressions.
Comparison operators do not support BLOB or CLOB type expressions. You can explicitly cast BLOBs to BYTE or VARBYTE and cast CLOBs to CHARACTER or VARCHAR, and use the result with comparison operators.
An expression that results in a UDT data type can only be compared with another expression that results in the same UDT data type.
A comparison operator—see Supported Comparison Operators.
An SQL scalar expression, including derived period expressions.
One of the following quantifier keywords:
  • ANY
  • SOME
  • ALL
Any of the following:
  • Defined value
  • Macro parameter
  • Built-in value such as TIME, DATE, or USER
The comparison operation may compare an expression against a list of explicit literals.
The data types of expression and literal must be compatible. If the data types of the operands differ, Vantage performs an implicit conversion from one type to another in some cases.
An SQL SELECT statement.
Using a subquery in a condition is restricted in certain cases.