Comparison Operator Syntax | Teradata Vantage - Comparison Operator Syntax - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
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.