1
我想加入三張表,products
,taxes
& categories
。所有這些表都有相互矛盾的列名。我知道我們通過創建別名來解決這個衝突。批量創建別名?
products:
id
name
...
taxes
id
name
...
categories
id
name
...
我的問題是,是否有一種方便的方式來批量創建別名?我的意思是一樣的東西
SELECT products.* as product.*, taxes.* as tax.*, categories.* as category.*
...
我期望的結果集,有一個像列:
product.id, product.name, tax.id, tax.name, ...
或者說,我要堅持的東西繁瑣爲:
SELECT products.id as product_id, products.name as product_name,
taxes.id as tax_id, taxes.name as tax_name, ...