All Forums Database
apurv_khare 3 posts Joined 04/15
14 Apr 2015
Pattern for LIKE Operator

Hi All,
I'm trying to search a specific pattern using LIKE operator, but i'm not sure if i'm doing the right way.
For Eg:
MY cloumn values are ABC_INFO_Calc, ABC_CALC_PRO, ABC_201501, ABC_201412.
I would like to slect the last two values and any value matching that (ABC_201501, ABC_201412).
I'm trying something like this  

where table_name like 'ABC_[0-9]%'

But no results while i run the query.
Can anyone help me with the parsing pattern in Teradata.

Glass 225 posts Joined 04/10
14 Apr 2015

This will work.

where table_name like 'ABC_%'
and table_name like any ('%1%','%2%','%3%','%4%','%5%','%6%','%7%','%8%','%9%');


dnoeth 4628 posts Joined 11/04
14 Apr 2015

If you're on TD14 you might use a Regular Expression:

where REGEXP_SIMILAR(table_name, 'ABC_[0-9].*') = 1



apurv_khare 3 posts Joined 04/15
26 Apr 2015

Thanks for the Reply, i'm using TD14 and that worked fine

You must sign in to leave a comment.