我正在尝试在我的工作台中打开一个脚本,但关键字 PIVOT 以红色下划线显示,并显示一条错误消息:` 语法错误,意外 IDENT_QUOTED。脚本:
select * from
(select c1.id, a.num0,a.num1 from table1 c1
Inner Join
(select c2.id, if(team=1,1,0) as num0, if(team=2,1,0)as num1 from table1 c2,table2 r2
where c2.q_id = 2046 and r2.q_id = 2046 group by c2.d)a on a.id = c1.id) pvt
PIVOT(
For content
IN([team1],[team2]))pvt2