Search code examples
sqldatabaseselectrenametablecolumn

How to rename columns with `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)


Solution

  • SELECT table1.price, table2.price AS other_price ...