I'm trying to select from multiples tables(10+) that are in the following format using mySQL.
+----------table(n)-----------+
+-----------------------------+
| url | id | ... |
+-----------+-----------+-----+
| url1.com | 12345678 | ... |
| url2.com | 45832458 | ... |
What I need to do is retrieve the id from each table for a given URL and return it in a single row like so.
+--------------table(n)--------------+
+------------------------------------+
| url | table(n) | table(n+1) |
+-----------+-----------+------------+
| url1.com | 12345678 | 8182735 |
But the URL might not exist for a given table, so I just need to retrieve all the ids from the tables where the URL is found.
For example, I have 10 tables and a URL/id is in 4 of them. I need to retrieve these 4, in a single row. I've tried to use aliases for columns along with various JOIN combinations to no avail.
Any help would be appreciated.