sql - Join over substring across tables in MSSQL -
I have a table that contains a column URL and another table with a substrings from that table < P> Table 1
id | URL ---------- 1 ... \ aaa_common \ 2 ... \ aaa_qa .. 3 ... \ aaa_test \ Analytics Table 2
some id | Compname ----------------- 1 aaa_common 2 aaa_qa 3 aaa_test It is possible to use the use of string functions (charindex and substrings). But is that an easy choice?
You can use this, but it will be a bit of a performance hit. From table_1 t1 inner join table_2 to t1.url like contact ('%', t2.compname, '%') T2 to
Select
Comments
Post a Comment