日期:2014-05-18  浏览次数:20597 次

不知道问题在那里了?
SQL code

SELECT s.SUBMITTIME ,s.FAULTLEVEL,COUNT(S.FLEVEL) AS [FLEVEL] 
FROM
(SELECT Convert(nvarchar(100),a.SUBMITTIME,23) AS SUBMITTIME, b.FAULTLEVEL AS FAULTLEVEL,b.FAULTLEVEL AS FLEVEL 
from
(select SUBMITTIME,FAULTLEVEL=convert(xml,'<root><v>'+replace(FAULTLEVEL,';','<
/v><v>')+'</v></root>') from [View_GetMMInfoForReport] as a 
outer apply
(select FAULTLEVEL=c.v.value('.','nvarchar(100)')
from a.FAULTLEVEL.nodes('/root/v') as c(v)
) as b
) as s
GROUP BY s.SUBMITTIME,s.FAULTLEVEL



消息 102,级别 15,状态 1,第 12 行
'FAULTLEVEL' 附近有语法错误。

不知道问题在那里了?

------解决方案--------------------
应该是 s.FAULTLEVEL 吧!?