I would like to check if a string in a certain cell of the database is part of a string in another cell of the same row.
The following example makes it more clear. Let's say that my table looks like this:
+---------+-----------------+
| Name | Couple |
+---------+-----------------+
| Mark | Mark & Thomas |
| Chris | Thomas & Logan |
| Patrick | Logan & Patrick |
| Thomas | Chris & Mark |
| Logan | Patrick & Chris |
+---------+-----------------+
Then the result of my query would have to be this:
+---------+-----------------+
| Name | Couple |
+---------+-----------------+
| Mark | Mark & Thomas |
| Patrick | Logan & Patrick |
+---------+-----------------+
Because Mark and Patrick are part of the string in the Couple field.
I gave it a try, but I don't think it's the right way to do this:
Select * from table where Couple like %Name%
Thanks for your answer(s)!