CASE

Translation reference to convert Teradata CASE statement to Snowflake Scripting

Description

Provides conditional execution of statements based on the evaluation of the specified conditional expression or equality of two operands.

The CASE statement is different from the SQL CASE expression, which returns the result of an expression.

For more information regarding Teradata CASE, check here.

-- Simple CASE
CASE operant_1
[ WHEN operant_2 THEN
     statement
     [ statement ]... ]...
[ ELSE   
     statement
     [ statement ]... ]
END CASE;

-- Searched CASE
CASE
[ WHEN conditional_expression THEN
     statement
     [ statement ]... ]...
[ ELSE   
     statement
     [ statement ]... ]
END CASE;

Sample Source Patterns

Sample auxiliar table

Simple Case

Teradata

Snowflake Scripting

Searched Case

Teradata

Snowflake Scripting

Known Issues

No issues were found.

No related EWIs.

Last updated

Was this helpful?