1 select SourceUid from WmsUnPack where State = 9
查询后的结果
更改SQL 语句为
1 select b.COl2 from 2 (select SourceUid,COl2=convert(xml,‘ <root> <v>‘+replace(SourceUid,‘,‘,‘ </v> <v>‘)+‘ </v> </root>‘) from WmsUnPack where State = 9)w 3 outer apply 4 (select Col2=C.v.value(‘.‘,‘nvarchar(100)‘) from w.COl2.nodes(‘/root/v‘)C(v)) b
查询结果
原文:https://www.cnblogs.com/Loners/p/11460812.html