I have two tables A and B. Table A has column identifiers, name and value. Among the other columns in table B, there is a column named IssueID. A.Value has values ββlike "ForSymbol12345", and B.IssueID has values ββlike "12345". I can join these two tables on some identifier columns in the respective tables. However, I only want to select those rows where B.IssueID is present in the value of A.Value. In other words, B.IssueID is a substring of A.Value.
Can this be done in SQL? I tried to use CONTAINS (string, "value to search"), but apparently the second parameter should be a string and cannot be a column name. I tried both
CONTAINS(A.Value, B.IssueID)
But it gives an error saying that 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?
source share