SQL comma-separated row with Group By clause

前端 未结 3 1775
花落未央
花落未央 2020-11-27 23:13

I have the following query:

SELECT
  Account,
  Unit,
  SUM(state_fee),
  Code
FROM tblMta
WHERE MTA.Id = \'123\'
GROUP BY Account,Unit

Thi

3条回答
  •  孤城傲影
    2020-11-28 00:08

    There is no built-in aggregate function to concatenate, but this article discusses several alternative solutions, including a user-defined concatenate aggregate function:

    https://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/

提交回复
热议问题