First of all and before detailing the problem I'm dealing with let me tell you that I'm currently an SQL-newbie so whenever it's possible I'll appreciate plain explanations and simple solutions. Here's what I have:
Given this query:
SELECT
table1.id as id,
table1.tag1 as tag1,
table2.tag2 as tag2,
table2.tag2 like '%'+table1.tag1'%' as match
FROM table1
INNER JOIN table2
ON table1.id = table2.id
I'm getting this table:
id tag1 tag2 match
1 ice cream ice-cream false
2 sweets sweets true
3 bakery bakery true
4 sweets ice-cream false
The problem I want to solve is that I'd want "match" column to interpret as "true" similar words as those from the first row. Therefore in my desired output I'd like this mentioned cell to be "true" instead of "false".
Thanks in advance.