I am inserting all values from a table into another table, which is created on the fly. I want to insert one extra column with constant value to the new table I create.
I have my FinSls
table like this,
Time Terminal_ID Count
------------------------------------
2017-10-19 06:03:00 1 5
2017-10-19 06:04:00 1 2
2017-10-19 06:05:00 1 2
2017-10-19 06:06:00 1 2
2017-10-19 06:03:00 9 2
2017-10-19 06:04:00 9 3
2017-10-19 06:05:00 9 2
2017-10-19 06:06:00 9 3
I am creating a new table BinTable
and I want to add a column cons_val
with a constant value, for example: 1, like this,
Time Terminal_ID Count Cons_value
------------------------------------------------
2017-10-19 06:03:00 1 5 1
2017-10-19 06:04:00 1 2 1
2017-10-19 06:05:00 1 2 1
2017-10-19 06:06:00 1 2 1
2017-10-19 06:03:00 9 2 1
2017-10-19 06:04:00 9 3 1
2017-10-19 06:05:00 9 2 1
2017-10-19 06:06:00 9 3 1
So far I have my script like this,
select *
into
BinTable
from
FinlSls
How can I add a new column Cons_Value
into my BinTable
? I saw this post that already has the table created and then inserting value. But in my situation, how can I do this?
Any help would be awesome.