Hi everyone, I've been working hours trying to get the following query done without any success

What I'm trying to do is sort of intersecting three tables in MySQL, here is an example of the data:
Code: Select all
Table1 Table2 Table3 Expected Result
Josh Jack Andrew Josh
Jack Josh Kevin Jack
Mary Sandy Peter Peter
Peter Roger Roger
Roger Josh Sandy
Martha Sandy
As you can see the main idea is, if there is one repeated name in either table I have to show it. And that is just the easy part, I still have the problem where I can have two or more MySQL Tables, but lets just concentrate on this basic example right now, I'll worry about constructing the query with PHP code later on
Thanx in advance, I appreciate your help!