I would like to check if a column string is contained in the other column.
Table emaillist:
complete_email
---------------------------------
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Table emailpartial:
username
--------------------
zazumba
maryhelp
neil
The query I want to perform:
select e.complete_email
from emailslist e, emailpartial ep
where e.complete_email like '%ep.username%';
I would expect a result like:
complete_email
---------------------------
[email protected]
[email protected]
[email protected]
However, it is not the right way of writing this sql query. Can someone clarify how can I write it?
Thanks, Samuel