SQL Query to Group By and Concat rows

前端 未结 1 745
不知归路
不知归路 2021-01-27 02:12

Hi I have the following table:

Doc      |  code    | Qty | Next
5211386  |  91992   |  1  | 52183
5211386  |  91992   |  1  | 52182

I trying to

相关标签:
1条回答
  • 2021-01-27 02:44

    Sounds like you're looking for a group_concat like function found in MySQL. Check out Allen Browne's solution

    SELECT Doc, code, Sum(Qty), ConcatRelated("[Next]","TableName",,,"-") as [Next]
    FROM TableName
    GROUP BY Doc, code
    
    0 讨论(0)
提交回复
热议问题