跪求一sql语句,在线等 http://bluebing.iteye.com/admin/blogs/1033726 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select id, [name]=stuff((select ','+[name] from tb t where id=tb.id for xml path('')), 1, 1, '') from tb group by id mysql下:select id,GROUP_CONCAT(distinct name) from table GROUP BY id; 列值合并的问题用F姐的SELECT id , [name] = STUFF(( SELECT ',' + [name] FROM tb t WHERE id = tb.id FOR XML PATH('') ), 1, 1, '')FROM tbGROUP BY id SQL数据库服务器的配置 客户端配置 将execl的数据导入到sql 2005中 视图索引问题(Sql高手请进) sql server 2005中如何将表的横向数据转换成纵向数据 求一个SQL语句? 有趣的问题,SQL Server的BUG! 搞了一天還沒答案.請專家幫我看看(參數傳值問題) SQL 2000返回的错误信息哪里储存? 用select如何实现这功能? 基础基础基础 sqlserver临时表性能问题 自定义函数不能做insert,update的操作。 请问这种需求该怎么办
select id, [name]=stuff((select ','+[name] from tb t where id=tb.id for xml path('')), 1, 1, '')
from tb
group by id
select id,GROUP_CONCAT(distinct name) from table GROUP BY id;
用F姐的
SELECT id ,
[name] = STUFF(( SELECT ',' + [name]
FROM tb t
WHERE id = tb.id
FOR
XML PATH('')
), 1, 1, '')
FROM tb
GROUP BY id