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

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/djk1612415574830.ditamap
dita:ditavalPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/wrg1590696035526.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantageâ„¢
{ expression_1 operator expression_2 |
  expression_1 operator quantifier ( literal [,...] ) |
  expression_1 operator [ quantifier ] ( subquery ) |
  ( expression_1 [,...] ) operator [ quantifier ] ( subquery )
}

Syntax Elements

expression_1
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.
operator
A comparison operator—see Supported Comparison Operators.
expression_2
An SQL scalar expression, including derived period expressions.
quantifier
One of the following quantifier keywords:
  • ANY
  • SOME
  • ALL
literal
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.
subquery
An SQL SELECT statement.
Using a subquery in a condition is restricted in certain cases.