I'm using SQL Server, and I have this data:
NO_PO_MYSAP ID_PLANNING_DETAIL ITEM BL
5501 13683 6 2019-11-28
5501 13683 7 2019-11-28
1101 13685 6 2019-12-10
1101 13685 6 2019-12-11
1101 13685 7 2019-12-10
1101 13685 7 2019-12-11
You can see that they have different no. of rows under the same NO_PO_MYSAP, because when I. select distinct, BL for 13685 has different values.
What I want is, if BL returns different values under similar NO_PO_MYSAP, I want those values to be sticked together so I still get 2 rows of data as in ID_PLANNING_DETAIL = 13683 (no. of rows depend on no. of ITEM, in this case they are 6 and 7).
So the return data will look like this:
NO_PO_MYSAP ID_PLANNING_DETAIL ITEM BL
5501 13683 6 2019-11-28
5501 13683 7 2019-11-28
1101 13685 6 2019-12-10, 2019-12-11
1101 13685 7 2019-12-10, 2019-12-11