Anchor Name Literal Expressions - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

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-04-05
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

The following table lists the ANCHOR anchor_name variables for the EXPAND ON clause.

Anchor Name Description
ANCHOR_MILLISECOND Produces multiple expanded rows, one for each millisecond in the input period.
ANCHOR_SECOND Produces multiple expanded rows, one for each second in the input period.
ANCHOR_MINUTE Produces multiple expanded rows, one for each minute in the input period.
ANCHOR_HOUR Produces multiple expanded rows, one for each hour in the input period.
DAY The expansion interval is INTERVAL '1' DAY for each expanded row.
WEEK_BEGIN Produces multiple expanded rows, one for each beginning value of a week present in the input period.
WEEK_END Produces multiple expanded rows, one for each ending value of a week present in the input period.
MONTH_BEGIN Produces multiple expanded rows, one for each beginning value of a month present in the input period.

An example query that uses such expansion is “Get the month end average inventory cost during the last quarter of the year 2010."

MONTH_END Produces multiple expanded rows, one for each ending value of a month present in the input period.
QUARTER_BEGIN Produces multiple expanded rows, one for each beginning value of a quarter present in the input period.
QUARTER_END Produces multiple expanded rows, one for each ending value of a quarter present in the input period.
YEAR_BEGIN Produces multiple expanded rows, one for each beginning value of a year present in the input period.
YEAR_END Produces multiple expanded rows, one for each ending value of a year present in the input period.
MONDAY An anchor period expansion produces rows whose period beginning bounds are always aligned to specific DateTime values derived from the anchor names.

For this specification, the period beginning bound is the first Monday in the specified period.

TUESDAY The period beginning bound is the first Tuesday in the specified period.
WEDNESDAY The period beginning bound is the first Wednesday in the specified period.
THURSDAY The period beginning bound is the first Thursday in the specified period.
FRIDAY The period beginning bound is the first Friday in the specified period.
SATURDAY The period beginning bound is the first Saturday in the specified period.
SUNDAY The period beginning bound is the first Sunday in the specified period.