0

Using TSQL Group by how to get from

Id value

    1  a
    2  b
    3  b

To

Ids Value Quantity
1    a    1
2,3  b    2
user2864740
  • 60,010
  • 15
  • 145
  • 220
AnxiousdeV
  • 373
  • 1
  • 3
  • 20
  • There is no 'simple' way to get a 'string concat aggregate' in TSQL. Approaches involved XML and string manipulation and CLR UDFs. There are many duplicates. – user2864740 Jul 24 '15 at 22:00
  • Maybe better: http://stackoverflow.com/questions/6899/how-to-create-a-sql-server-function-to-join-multiple-rows-from-a-subquery-into – user2864740 Jul 24 '15 at 22:02
  • And see http://msdn.microsoft.com/en-us/library/ms131056.aspx for a CLR UDF – user2864740 Jul 24 '15 at 22:02

0 Answers0