Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

fast way to join on "like" operator sql

$
0
0

i need to do join between to tables using "like" operator or any other way that gets the same result, So I tried the following:

selectfrom tbl1leftjoin tbl2 on tbl1.X like'%'+tbl2.Y+'%'

but the performance was not good and it took time to finish; so I tried the following hoping things will speed up:

select*from tbl1 leftjoin tbl2 oncharindex(tbl2.Y,tbl1.X)>0

but it didn't improve much or even i can say it didn't improve at all; so I'm wondering if there is a way faster than the above two ?!


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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