I have the sample values as shown in the image attached. What I want to achieve is that the value of PR_NUMBER field gets concatenated on the basis of same values in PO_NUMBER and PO_ITEM.
Though this is a sample data, any n number of rows can have the same values and hence the concatenation of all such values in the PR_NUMBER column need to be done.
I got to know about CURSORS to loop through the table but don't really know what to do with them.
Expected output image is
123 | 1 | 5678,6789
456 | 1 | 2322,3432
456 | 2 | 4678
If you are using SAP HANA then you can use STRING_AGG(Name, ',')
instead if you are using mysql you can use group_concat