Selecting all columns and constant value from Oracle table

CooperMAN picture CooperMAN · Nov 16, 2011 · Viewed 37.5k times · Source

How can I select all columns and add a column with a constant value in Oracle?

With MS SQL Server, I can use:

Select *,5 From TableA;

I will get this:

column1      column2    5
xx           xx         5
xx           xx         5

Answer

Jeremy Thompson picture Jeremy Thompson · Nov 16, 2011

See this tutorial: Select constant as a Column

Select *,5 as "ConstColumn" From TableA;