SQL, How to Concatenate results?

前端 未结 7 1938
渐次进展
渐次进展 2020-11-29 08:08

I currently have a SQL query that returns a number of fields. I need one f the fields to be effectively a sub query sub that.

The Problem in detail:

7条回答
  •  隐瞒了意图╮
    2020-11-29 08:39

    It depends on the database you are using. MySQL for example supports the (non-standard) group_concat function. So you could write:

    SELECT GROUP_CONCAT(ModuleValue) FROM Table_X WHERE ModuleID=@ModuleID
    

    Group-concat is not available at all database servers though.

提交回复
热议问题