This is quite difficult to explain but, I have a table (tenant) with a column called occupant. I want to know if the value in the column fully/partially matches the value in another table (offensive) with only one column called bad_words.
i.e.
tbl_Tenant.Occupant
------------------
Julia f*t
P*y Girl
Gary A*e
tbl_Offensive.bad_words
---------
s*t
f*t
p*y
a*e
I know the following query is incorrect but I'm trying to do something like this but cant think of the correct way to script it.
select * from tbl_tenant t
where t.occupant like '%(select o.bad_words from tbl_offensive o)%'
Can someone please help!