Teradata Built-In Functions: TO_NUMBER, TRUNC, CEILING, FLOOR, LEAST, GREATEST, ROUND

sql4

TO_NUMBER I have often needed a function to verify whether a character column contains a numeric value. Typically, I have resorted to using a workaround, such as: CASE WHEN UPPER(‘12.77’) = LOWER(‘12.77’) THEN ‘IS_NUMERIC’ ELSE ‘IS_NOT_NUMERIC’ END Naturally, this workaround is limited and cannot manage certain situations, such as consecutive special characters. With the introduction …

Read more

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

sql2

 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: You must create your …

Read more

Teradata Date Format and Time Values: Common Questions Answered

sql2

This article will address some common questions about formatting date and time values in Teradata. Teradata is a powerful relational database management system (RDBMS) that provides various functions to manipulate and manage date and time values. Understanding how to work with date and time data is essential for anyone using Teradata, so let’s look at …

Read more

Understanding Teradata’s SAMPLE Function: Randomly Select Rows and More

sql1

What is the Teradata Sample Function? The SAMPLE function returns a set of randomly selected rows. Here are the characteristics: The Syntax of the Sample Function SAMPLE [WITH REPLACEMENT] [RANDOMIZED ALLOCATION][WHEN <condition> THEN] {<number of row> | <percentage>} […,<number-of-rows> | <percentage>][ELSE {<number of rows> | <percentage } END] Here are some examples of how to …

Read more

Practical Approach for Teradata SQL Tuning: Finding the Root Cause of Performance Issues

sql3

To optimize Teradata SQL performance, it is crucial to identify the root cause of any issues. The SQL statement itself is typically not the culprit but rather one or more stages of the execution plan. This article does not cover genuine optimization techniques. Instead, it presents a pragmatic method for query optimization. I have noticed …

Read more

DWHPro

Expert network for enterprise data platforms. Senior consultants, project teams built for your challenge — across Teradata, Snowflake, Databricks, and more.

📍Vienna, Austria & Jacksonville, Florida

Quick Links
Services Team Teradata Book Blog Contact Us
Connect
LinkedIn → [email protected]
Newsletter

Join 4,000+ data professionals.
Weekly insights on Teradata, Snowflake & data architecture.