LIKE operator in Snowflake

Viewed 32

Is there any way to code this in snowflake?

Table 1

enter image description here

Based on look up table's DEPT, I want to have values like below in main table

enter image description here

This means, when it is SALES INTERNAL and then extra texts it should take the value of "SALES INTERNAL" as data access.

Below code produces duplicates.

ON LOWER (LTRIM(RTRIM(nvl(MainTable."DEPT", 'NA')))) ilike  LOWER (LTRIM(RTRIM(nvl(LookUpTable."DEPT,'NA')))||'%')

Any help is appreciated.

0 Answers
Related