March 30, 2020 at 7:38 pm
I have the following query:
Select mx.vserie, mx.vfolio from data1 mx inner join data2 my on mx.vfolio = my.voucher
I need to search the value of mx.vfolio as a substring of my.voucher.
thank you in advance.
March 30, 2020 at 8:21 pm
Sure. Use CHARINDEX to search for one string within another.
If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.
See https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help/ for details of how to post T-SQL code-related questions.
March 31, 2020 at 2:19 am
Just plan on such a thing doing full table scans because the JOIN criteria will become non-SARGable.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply