Say I have two tables, and they have several column names that are the same
in both tables. I know I can manually alias the column names so that they
don't overlap, but is there a way to prefix *all* of the columns of one
table so that I can be sure the names don't overlap?
So if I have these two tables:
then I could use a query like:
person.*,place.* as home_*
person.home_id = place.id
name = 'Joe'
To get back results like:
The problem is that I don't want to have to update my queries everytime I
add a new column, so I use table_name.* a lot. But then if I ever add a
column with the same name to another table, I will only get one column or
the other back.
Does MySQL do this? Should it?