【发布时间】:2010-10-30 18:40:33
【问题描述】:
如果我有这样的表:
+------------+
| Id | Value |
+------------+
| 1 | 'A' |
|------------|
| 1 | 'B' |
|------------|
| 2 | 'C' |
+------------+
我怎样才能得到这样的结果集:
+------------+
| Id | Value |
+------------+
| 1 | 'AB' |
|------------|
| 2 | 'C' |
+------------+
我知道在 MySQL 中使用 GROUP_CONCAT 很容易做到这一点,但我需要能够在 MSSQL 2005 中做到这一点
谢谢
(How to use GROUP BY to concatenate strings in SQL Server? 的重复)
【问题讨论】:
标签: sql sql-server group-by string-concatenation