Reputation: 121
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
Upvotes: 12
Views: 45956
Reputation: 160
I don't think this is really possible, because the * character is not a replacing content. I get back this error: ORA-00923
Upvotes: 2
Reputation: 65624
See this tutorial: Select constant as a Column
Select *,5 as "ConstColumn" From TableA;
Upvotes: 14