Vote count:
0
I can put the following into SqlFiddle:
create table #xt (WOT varchar(10), NN float)
insert into #xt values ('YTD_PC',0)
insert into #xt values ('MTD_PC', 1)
insert into #xt values ('MTD_SALES', 1)
insert into #xt values ('YTD_SALES', 2)
insert into #xt values ('MTD_CS', 99.15)
insert into #xt values ('YTD_CS', 470)
select * from #xt
PIVOT
(
MAX(NN)
for WOT in (YTD_SALES,YTD_CS,YTD_PC,MTD_SALES,MTD_CS,MTD_PC)
) as PIVOtTable
See: SQLFiddle
Yet, when I enter the same code into SSMS, I get an error pointing to the "MAX(NN)" line:
Msg 102, Level 15, State 1, Line 12
Incorrect syntax near ')'.
This has been bugging me all day ... I can't figure it out. Can anyone point me to where the error is ??
asked 36 secs ago
Error using Pivot Table in SQL Server 2008
Aucun commentaire:
Enregistrer un commentaire