标签:for sp on c r bs as rom view
ALTER view [dbo].[view_weiswysjl]
as
select distinct m.dbid,m.baogbh,m.chanpmc,m.jianymdyq,m.weitrq,(‘,‘+s.jjy+‘,‘) as jjy from mainexam m inner join
(select baogbh,STUFF( (SELECT ‘,‘+jjy from secexam s2 WHERE s1.baogbh=s2.baogbh FOR XML PATH(‘‘)),1,1,‘‘) jjy from secexam s1 ) s
on m.baogbh=s.baogbh
where dbstatus>0 and dbstatus!=9
GO
标签:for sp on c r bs as rom view
原文地址:http://www.cnblogs.com/XIAO-BAI/p/3981519.html