akosch akosch - 1 year ago 86
SQL Question

How can I rename a single column in a table at select?

I have two tables with one identical column name, but different data. I want to join the tables, but access both columns (row["price"], row["other_price"]): How can I rename/alias one of them in the select statement? (I do not want to rename them in the DB)

Answer Source

select table1.price, table2.price as other_price .....

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download