Change column name in Oracle in SELECT statement

CathalMF picture CathalMF · Jul 30, 2013 · Viewed 90.4k times · Source

In MSSQL I can select a column and change the column header by doing:

SELECT mycolumn as 'MyNewColumnName' from MyTable

This doesn't work in Oracle. How do I perform the same thing in Oracle?

Answer

Nick Krasnov picture Nick Krasnov · Jul 30, 2013
  1. Remove single quotation marks

    SELECT mycolumn as MyNewColumnName 
      from MyTable
    
  2. Enclose alias in double quotation marks

    SELECT mycolumn as "MyNewColumnName" 
      from MyTable