WHERE Clause - Teradata Database

SQL Data Manipulation Language

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-10-06
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata® Database

Filters rows that satisfy a conditional expression in SELECT, DELETE, INSERT, UPDATE, ABORT, and ROLLBACK statements.

where:

 

Syntax Element …

Specifies …

WHERE

an introduction to the search condition in the SELECT statement.

search_condition

a conditional search expression, also referred to as a conditional expression or predicate, that must be satisfied by the row or rows returned by the statement.

The arguments can be any valid SQL expression, including individual values, user‑defined functions, DEFAULT functions, and subqueries, but the overall expression must be of a form that returns a single boolean (TRUE or FALSE) result.

Logical expressions include comparisons of numeric values, character strings, and partial string comparisons.

You cannot specify an expression that returns an ARRAY or VARRAY data type in a WHERE clause search condition. See SQL Functions, Operators, Expressions, and Predicates for more information about relational operators and expressions.

Scalar subqueries are valid search conditions.

You cannot specify expressions that contain LOBs in a search condition unless you first cast them to another data type (for example, casting a BLOB to BYTE or VARBYTE or a CLOB to CHARACTER or VARCHAR) or pass them to a function whose result is not a LOB.

Subqueries in a search condition cannot specify SELECT AND CONSUME.

You can only specify a scalar UDF for search_condition if it is invoked within an expression and returns a value expression.

If you specify the value for a row-level security constraint in a search condition, it must be expressed in its encoded form.