SQL concatenate rows query

前端 未结 3 584
礼貌的吻别
礼貌的吻别 2021-01-15 12:53

Say we have a table

table posts
+---------+-----------+--------------------------------+
| postId  | title     | status    | bodyText           |
+--------         


        
3条回答
  •  不要未来只要你来
    2021-01-15 13:08

    You didn't indicate a particular SQL engine.

    In Firebird (from 2.1) you can use the LIST() function. Take a look at: link text

    It's an aggregate function to do exactly what you need.

    I guess it exists in other engines (LIST in Sybase SQL Anywhere, GROUP_CONCAT in MySQL)

提交回复
热议问题