I am new to Teradata Dev.Could you please help me with the below request.
CASE WHEN Tablename.ID LIKE 'pattern matching' THEN 'CNN'
Sample IDs :1-1NRVGXL,1-229HGKM,1-RMKZWA
So,how to write pattern matching for this.
Thanks in advance.
What kind of pattern?
There's no explanation what you want to match.
If you mean a Regular Expression have a look at REGEXP_SIMILAR
ID's are of alpha numeric,please see below samples.
I want a like condition for this using wilcard string.
Just a stab ... but while you give dieter his answer in case it is an involved match, you aren't just asking for how to wildcard, are you?
You can do something like:
WHEN Tablename.id LIKE '%cnn%' THEN 'CNN'
END AS CASE_MATCH
Also if you know what position to expect the string you are looking for you can do a substring.