Teradata ISNULL Alternatives

access_time 14 days ago visibility12 comment 0

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 at 14 days ago copyright This page is subject to Site terms.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

Kontext Column

Created for everyone to publish data, programming and cloud related articles.
Follow three steps to create your columns.


Learn more arrow_forward

More from Kontext

local_offer teradata local_offer teradata-utilities

visibility 12
thumb_up 0
access_time 8 days ago

BTEQ is a Teradata utility tool that can be used to run Teradata SQL statements incl. DDL, DML, etc. It can also be used to import data from text file into Teradata databases. Like TPT and FASTLOAD, it can run in both batch and interactive modes. This article demonstrates how to load XML fi...

local_offer teradata local_offer fastload local_offer teradata-utilities

visibility 10
thumb_up 0
access_time 8 days ago

Teradata FastLoad can be used to load CSV/TSV or other delimited files into database. Refer to article  Teradata FastLoad - Load CSV File  for more details about how to load CSV into Ter...

local_offer teradata local_offer fastload local_offer teradata-utilities

visibility 11
thumb_up 0
access_time 8 days ago

In article  Teradata FastLoad - Load CSV File , it shows how to load CSV into Teradata. The input file is very basic CSV file.  This article expands on t...

About column

Teradata

Tutorials and information about Teradata.

rss_feed Subscribe RSS