我有两个表有一个相同的列名,但数据不同.我想加入表,但访问两列(row ["price"],row ["other_price"]):如何在select语句中重命名/别名?(我不想在DB中重命名它们)
选择table1.price,table2.price作为other_price .....
select t1.Column as Price, t2.Column as Other_Price from table1 as t1 INNER JOIN table2 as t2 ON t1.Key = t2.Key
像这样 ?
我们AS关键字
select a.Price as PriceOne, b.price as PriceTwo from tablea a, tableb b