I have two tables A and B. Table A has columns ID, Name and Value. Among other columns in table B, there is a column called IssueID. A.Value has values something like 'ForSymbol12345' and B.IssueID has values like '12345'. I am able to join these two tables on some ID columns in respective tables. However, I only want to select those rows where B.IssueID is present in A.Value value. In other words, B.IssueID is a substring of A.Value.
Can it be done in SQL? I tried using CONTAINS(string, 'value to search for') but apparently second parameter must be string and cannot be column name. I tried like
CONTAINS(A.Value, B.IssueID)
But it gives an error saying the second parameter is expected to be String, TEXT_LEX or Variable (a simplified example showing this below)
Can someone help me figure this out?