I think he's asking for a way to get the table name containing the value rather than get the results themselves.
The query might look something like this
- Code: Select all
SELECT t1.f4 AS table1, t2.f4 AS table2, t3.f4 AS table3, t4.f4 AS table4, t5.f4 AS table5
FROM t1
LEFT JOIN t2 ON (t1.f4=t2.f4)
LEFT JOIN t3 ON (t2.f4-t3.f4)
LEFT JOIN t4 ON (t3.f4=t4.f4)
LEFT JOIN t5 ON (t4.f4=t5.f4)
WHERE t1.f4 = 'felix' OR t2.f4 = 'felix' OR t3.f4 = 'felix OR t4.f4 = 'felix' OR t5.f4 = 'felix'
That query above will give alarge result set but basically the columns it returns will be named table1-5 respectively. It's then a matter of checking if any of the rows return have a value of felix under table-15