How to “Implode” (de-normalize/concat) multiple columns into a single column?

后端 未结 4 1939
别跟我提以往
别跟我提以往 2021-01-17 23:46

I have a query which outputs something like this:

+-------+----+--------------+
| F_KEY | EV | OTHER_COLUMN |
+-------+----+--------------+
| 100   | 1  | ..         


        
4条回答
  •  隐瞒了意图╮
    2021-01-18 00:03

    Look into using FOR XML PATH, you can convert it use the xml string just like a varchar, this supports a seperating character/expression as well. It will go at the end of your query but will most likely require you to use a subquery structure.

提交回复
热议问题