DWHPro Insights

Recursive SQL

Date ranges and business calendars beyond recursion and Teradata SYS_CALENDAR Popular

Illustration of a glossy orange database cylinder with data fragments across its surface

In a previous article, Roland explained how to use recursion to build a data range without touching a physical table. This time, we explore an alternative approach that avoids recursion using a one-row metadata source whose AMP access depends on the plan. We can use this approach to build both a wide date range and …

Read more

The Teradata Recursive Query for Performance Tuning

Illustration of a glossy orange database cylinder with data fragments across its surface

Problem-solving without a Teradata Recursive Query To depict a corporate hierarchy in our instance, we can employ a non-recursive approach, illustrated by the query presented below: The above query has several harmful properties: Problem-solving with a Teradata Recursive Query The above recursive query has several benefits: The path is bounded by VARCHAR(1024), and the query …

Read more

An Introduction to Teradata Recursions: Generating Date Ranges Without a Physical Table

Illustration of a glossy orange database cylinder with data fragments across its surface

 Introduction to Teradata Recursions To link records from a primary table with a specific date range from a secondary table, a common requirement is to create a simulated history table with snapshot dates using a change history table with defined timelines. Consider the following illustration: The proposed solution would resemble this: If the system calendar …

Read more

Protected by Security by CleanTalk and CleanTalk Anti-Spam