My table contains a column named "notes". I need to create a column Temper
in my report. If I spot a word "angry" in the notes, then my new variable Temper
should be 3
. If I spot a word "indifferent" then Temper=2
, otherwise Temper
should equal to 0
.
The initial table:
Id State Gender Notes
1 IL M Kind of angry, but...
2 MI F Maybe indifferent also...
3 IL F Was cool but not necces...
The result should be like this:
Id Temper
1 3
2 2
3 0
I am not sure how to do this in Teradata environment:
select Id, (notes like '%angry%')=3 else // ?????
from customers
where
case