陈宏举,困难职工补助申请书,江苏卫视2018跨年演唱会
将表中一个字段内容放在一起显示
[sql] --声明表变量 declare @t table (strid int,strname nvarchar(50)) --插入测试数据 insert into @t select 1,'a1' union all select 1,'a2' union all select 1,'a3' union all select 2,'b1' union all select 2,'b2' union all select 2,'b3' union all select 3,'c1' union all select 3,'c2' union all select 3,'c3' --计算结果 select t.strid, [contents] = stuff( ( select '/' + convert(nvarchar(50),r.strname) from @t r where r.strid=t.strid for xml path('') ), 1, 1, '' ) from @t t group by t.strid for xml path('') sql2005以后的版本支持生成一种xml文档的方式。 path(‘’):控制节点的名称
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
数据库SQL---数据库、基本表、视图、索引的定义、修改、删除
在 Azure CentOS VM 中配置 SQL Server 2019 AG - (上)
在 Azure CentOS VM 中配置 SQL Server 2019 AG - (下)
网友评论