Teradata sql case statement in volatile table

Create volatile table sample as

(select a.orig_name , a.sample_date,

CASE when a.orig_name = 'Apl' THEN 'APPLE'
    when a.orig_name = 'Orng' THEN 'ORANGE'
else 'other'

end as orig_name_grp

from tablename_fr)

with data primary index(sample_date) 
on commit preserve rows;

this code is throwing me error in teradata , can anyone help me fixing what the issue how to use CASE statement with condition on itin volatile table

case statement is throwing error in teradata in create volatile table

this is sample code ,i cannot post my original code due to some restriction ,
error message is
Failed [3706:42000] Syntax error :expected something between '=' and the end of the request

SQLTeam.com is a Microsoft SQL Server focused site, we are not experts on TeraData.

1 Like

hi hope this helps

= should be ==

Create volatile table sample as
(select 
       a.orig_name 
     , a.sample_date
	 , CASE when a.orig_name == 'Apl'  THEN 'APPLE'
            when a.orig_name == 'Orng' THEN 'ORANGE'
            else 'other'
       END as orig_name_grp
 from 
    tablename_fr)
with data primary index(sample_date) 
on commit preserve rows;