Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selecting all columns and constant value from Oracle table

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
like image 729
CooperMAN Avatar asked Nov 16 '11 03:11

CooperMAN


1 Answers

See this tutorial: Select constant as a Column

Select *,5 as "ConstColumn" From TableA;
like image 188
Jeremy Thompson Avatar answered Oct 06 '22 11:10

Jeremy Thompson