My goal is to manipulate an existing database table by applying a scalar multiple, a discount rate, across all existing columns to generate a present value. Then I would like the output to to be a new table.
alter table dbo.[DBO]
add scalar as power(0.95,(9 + cast([rowno] as float))/12);
create table [Table] as
(select
ID,
sum([Column I] * scalar) as newI,
sum([Column J] * scalar) as newJ
from dbo.[DBO]
group by ID);
When the code below is run, the following error message is returned:
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near '('.
It appears the error has to do with "(select", but I cannot make the proper edits to resolve it.