Teradata Functions

Explore frequently used Teradata SQL functions.

Teradata Functions

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 43
thumb_up 0
access_time 3 months ago

In SQL Server, ISNULL function is commonly used to populate a value for null columns.  In Teradata, there is no ISNULL function but COALESCE and CASE WHEN can be used as alternatives.  SELECT COALESCE(NULL,'ABC','CDE'); Result: ABC SELECT COALESCE(Col1, Col2,'DEFAULT') FROM ...

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 53
thumb_up 0
access_time 3 months ago

Teradata RPAD function is used to add repeated characters at the end of a string to increase the string to a specified length. It can be used to add trailing space or zeros to a string. RPAD(source_string, length, fill_string) Returns the source_string padded to the right with the characters in ...

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 152
thumb_up 0
access_time 3 months ago

Teradata LPAD function is used to add repeated characters at the beginning of a string to increase the string to a specified length. It can be used to add leading space or zeros to a string. LPAD(source_string, length, fill_string) Returns the source_string padded to the left with the ...

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 58
thumb_up 0
access_time 4 months ago

The following code snippets show how to use round numbers to hundreds or thousands in Teradata.  warning Alert - The following code snippets are used to round to the smallest hundreds or thousands that is equal or greater than the input number.  FLOOR and CEILING fun ctions In ...

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 354
thumb_up 0
access_time 4 months ago

In article   Teradata SQL - Use OREPLACE to Replace or Remove Characters , it shows how to use OREPLACE function in Teradata to replace or remove strings. This page will show one more alternative way of doing that using regular expressions. select oreplace('Kontext is a website for data ...

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 636
thumb_up 0
access_time 4 months ago

This page shows how to trim or remove leading or/and trailing zeros using Teradata SQL.

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 1334
thumb_up 0
access_time 8 months ago

OREPLACE functions in Teradata can be used to replace or remove characters from a string. OREPACE is Teradata's extension to ASNI SQL. The usual REPLACE function is not available. REPLACE function is commonly implemented in many other SQL databases such as SQL Server, MySQL, BigQuery, Oracle, etc.

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 421
thumb_up 0
access_time 9 months ago

Extract sub string from a string is a common operation in data analytics. In Teradata, function SUBSTRING (SUBSTR) and REGEXP_SUBSTR are provided to achieve that. SUBSTR is used to extract string from a specified location while REGEXP_SUBSTR is used to extract string using regular expressions. -- ...

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 331
thumb_up 0
access_time 9 months ago

In SQL Server, TRY_CAST function returns a value cast to a specified data type is the cast is successful or null is the cast is not successful.  In Teradata, the equivalent function is TRYCAST. -- return int 1030 SELECT TRYCAST('01030' AS int); -- return 2019-01-01 as it is a valid date ...

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 4095
thumb_up 1
access_time 9 months ago

In ANSI SQL, you can use DATEADD function to easily add or subtract days/week/months/years from a date as the following code snippet shows: SELECT DATEADD ( month , 1 , '20060830' ); SELECT DATEADD ( day , - 1 , '20060831' ); However in Teradata this function is not implemented and you ...

Read more

Find more tags on tag cloud.

launch Tag cloud