I have the following tables:
Product_Order
Order_Num Order_Date
1 10/12/2017
2 10/31/2017
3 11/01/2017
Product_Order_Dtl
Order_Num Product_Desc
1 Toy_01
1 Toy_02
1 Toy_03
2 Toy_01
2 Toy_05
3 Toy_01
I am trying to update the Product Order
Table to list all the products associated with that order into a new column called Product_List
. Just like the following:
Product_Order
Order_Num Order_Date Product_List
1 10/12/2017 Toy_01, Toy_02, Toy_03
2 10/31/2017 Toy_01, Toy_05
3 11/01/2017 Toy_01
Is there a way to do that using an update statement? I am using a version of SQL 2012.