SELECT trim(B.ORIGINAL_LIC_NUM) FROM CR_LIC_TEMP B, CR_TBL A
WHERE '%'||trim(B.ORIGINAL_LIC_NUM)||'%' in ( '%' || trim(A.ACTIVITY1)||' '||trim(A.ACTIVITY2)||' '||trim(A.ACTIVITY3)||' '||trim(A.ACTIVITY4)||' '||trim(A.ACTIVITY5)|| '%')
OR
'%' ||trim(B.CLEAN_LIC_NUM) ||'%' in ( '%' || trim(A.ACTIVITY1)||' '||trim(A.ACTIVITY2)||' '||trim(A.ACTIVITY3)||' '||trim(A.ACTIVITY4)||' '||trim(A.ACTIVITY5)|| '%')
Dear Experts,
Greetings..!!
I have problem,
Above is my query, where im trying to select ORIGINAL_LIC_NUM from CR_LIC_TEMP table.
In the above case, ACTIVITY1 to ACTIVITY5 is an actual string column from CR_TBL table, where ORIGINAL_LIC_NUM present along with other desciption, (please check the data).
Im writing the above query to select the ORIGINAL_LIC_NUM, which is present in either one among those 5 activities.
I have tried to replace IN with LIKE and '='.
But no luck.
Some body please advise
Thank you in advance
WHERE '%'||trim(B.ORIGINAL_LIC_NUM)||'%' in ( '%' || trim(A.ACTIVITY1)||' '||trim(A.ACTIVITY2)||' '||trim(A.ACTIVITY3)||' '||trim(A.ACTIVITY4)||' '||trim(A.ACTIVITY5)|| '%')
OR
'%' ||trim(B.CLEAN_LIC_NUM) ||'%' in ( '%' || trim(A.ACTIVITY1)||' '||trim(A.ACTIVITY2)||' '||trim(A.ACTIVITY3)||' '||trim(A.ACTIVITY4)||' '||trim(A.ACTIVITY5)|| '%')
Dear Experts,
Greetings..!!
I have problem,
Above is my query, where im trying to select ORIGINAL_LIC_NUM from CR_LIC_TEMP table.
In the above case, ACTIVITY1 to ACTIVITY5 is an actual string column from CR_TBL table, where ORIGINAL_LIC_NUM present along with other desciption, (please check the data).
Im writing the above query to select the ORIGINAL_LIC_NUM, which is present in either one among those 5 activities.
I have tried to replace IN with LIKE and '='.
But no luck.
Some body please advise
Thank you in advance