I'm trying to join three tables, products
, taxes
& categories
. All these tables have conflicting column names. I'm aware that we get around this conflict by creating aliases.
products:
id
name
...
taxes
id
name
...
categories
id
name
...
My question is, is there a convenient way to create aliases in bulk? What I mean is something like
SELECT products.* as product.*, taxes.* as tax.*, categories.* as category.*
...
I would expect the result set to have columns like:
product.id, product.name, tax.id, tax.name, ...
Or, do I have to stick with something tedious as:
SELECT products.id as product_id, products.name as product_name,
taxes.id as tax_id, taxes.name as tax_name, ...