Is it possible to write the following query so that instead of just field names, the result “keys” include the name of the table the fields belong to.
SELECT * FROM books
The result should look like:
| books.id | books.name | etc.
| 1 | She |
| 2 | Lolita |
If you plan query mysql via a programming language, all the mysql drivers I’ve come across have access to the table name(s) when retrieving result sets. So, you don’t need to change your query to rename columns to include the table name…you can just do it with code.
In your programming language of choice, look for a function that has a name similar to “meta data”. That’s likely one of the functions you’ll need.