I would like to check if a column string is contained in the other column.
Table emaillist:
complete_email
---------------------------------
zazumba@hotmail.com
jere@yahoo.com
maryhelp@aol.com
neil@cde.de
john_smith@zodll.ne
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
---------------------------
zazumba@hotmail.com
maryhelp@aol.com
neil@cde.de
However, it is not the right way of writing this sql query. Can someone clarify how can I write it?
Thanks, Samuel