Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Join two tables using like statement - response (3) by Raja_KT

$
0
0

Hi ,
From the sample data you provide and join , I can see that you need to extract the string to match, like substr. This is going to be expensive. Just as a starting point you can think this just as a sample script. You can modify as per your reqt.

select t1.cola,t1.colb,case when T1.ColA=substr(T2.ColA,1,5) then t1.colc end  from Table1 T1

left join Table2 T2

on T1.ColA=substr(T2.ColA,1,5)

and T1.ColB = T2.ColB

 

Cheers,

Raja


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>