Teradata ISNULL Alternatives

visibility 805 access_time 2 years ago languageEnglish

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. 

Use COALESCE function

SELECT COALESCE(NULL,'ABC','CDE');

Result:

ABC

Apply to a column or expression

SELECT COALESCE(Col1, Col2,'DEFAULT') FROM DatabaseName.TableName;

Use CASE WHEN statement

SELECT CASE WHEN Col IS NULL THEN 'DEFAULT' ELSE Col END FROM DatabaseName.TableName;

Remember to change database, table and column names accordingly. 

info Last modified by Administrator 2 years ago copyright This page is subject to Site terms.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

timeline Stats
Page index 1.30
More from Kontext
Convert varchar to date in SQL / Teradata
visibility 8,699
thumb_up 1
access_time 3 years ago
Teradata tdwallet Examples
visibility 1,840
thumb_up 0
access_time 2 years ago