combine multiple rows int one row with many to many

后端 未结 2 413
臣服心动
臣服心动 2021-01-29 02:34

Using SQL Server I have the following tables/ data

CUS_VISIT

Cus_ID    Cus_Vis_ID
1           01
1           02
2           01


        
相关标签:
2条回答
  • 2021-01-29 03:22

    You need to do a subquery within your select in order to concatenate values from multiple rows into a single row.

    See this answer for a solution: https://stackoverflow.com/a/545672/745511

    0 讨论(0)
  • 2021-01-29 03:29

    i resolved this issue by creating a view that just associates the prt_cd with the event and then another view based on this one that combines (concatenates) all of the prt_cd s for one event... not sure why but was never able to find a way to do is all in one shot with one query.

    0 讨论(0)
提交回复
热议问题