How do I implement such scenario in Teradata
If Col1 is null or if Col1 = ''Jack'' then Col2 else Col1
I ha e implemented it but for some reason it's not working may be some issue with Bracketay
2 Answers
You can also use the NULLIF() operator:
COALESCE(NULLIF(col1,'Jack'), col2) This is logically equivalent to the CASE statement in the previous answer.
You can use a case expression:
case when col1 is null or col1 = 'Jack' then col2 else col1
endString (varchar) constants need to be enclosed in sinqle quotes in SQL.
1