日期:2014-05-17 浏览次数:20556 次
WITH a1 (msg) AS
(
SELECT '1
------解决方案--------------------
1.1
------解决方案--------------------
2.2
------解决方案--------------------
3.3
------解决方案--------------------
4.4
------解决方案--------------------
5.5
------解决方案--------------------
6.2,2
------解决方案--------------------
1.2
------解决方案--------------------
2.2
------解决方案--------------------
3.2
------解决方案--------------------
4.5
------解决方案--------------------
5.7
------解决方案--------------------
6.3,3
------解决方案--------------------
1.5
------解决方案--------------------
2.6
------解决方案--------------------
3.5
------解决方案--------------------
4.4
------解决方案--------------------
5.9
------解决方案--------------------
6.5,4
------解决方案--------------------
1.5
------解决方案--------------------
2
------解决方案--------------------
3.5
------解决方案--------------------
4
------解决方案--------------------
5
------解决方案--------------------
6.9'
)
,a2 AS
(
SELECT b.msg,ROW_NUMBER() OVER (ORDER BY GETDATE()) re
FROM
(SELECT msg=CONVERT(XML, '<root><v>'+replace(RTRIM(LTRIM(msg)),',','</v><v>')+'</v></root>') FROM a1) a
OUTER APPLY
(SELECT msg = C.v.value('.','NVARCHAR(MAX)') FROM a.msg.nodes('/root/v') C(v)) b
)
,a3 AS
(
SELECT a.re,b.msg,ROW_NUMBER() OVER (PARTITION BY a.re ORDER BY GETDATE()) re2
FROM
(SELECT re,msg=CONVE