Skip to content
Advertisement

How to select rows from table 2 based on values in column from table 1 in SQL Teradata?

I have table in SQL Teradata:

And I need to find only these clients which has their name (from column “client”) + “arg” or “por” in column “descpition” nevermind whether before or after name. So using above example I need to display only John Simon and Larry Fore, because they have their name in column “description + “arg” or “por” nevermind whether before or after name.

How can I do that?

Advertisement

Answer

One method is:

The delimiters in the second part are just to avoid matches for a name like “Portland”.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement