Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Comparing functions problem

$
0
0
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

Attached Images
File Type: jpg Activity_Smapl.jpg (143.3 KB)

Viewing all articles
Browse latest Browse all 13329

Trending Articles