I have 1 query and result display as following table:
ID
ProductsName
Suppliers
001
Pencil_1
ABC
001
Pencil_2
ABC
002
Ruler
XYZ
I want to combine ProductsName and Suppliers columns for duplicate ID and separate by comma, if the column has same result like Suppliers for ID=001, it will display once as following table:
This link is written for Microsoft SQL Server but it should help provide some general concepts that will work in Oracle. The XML methods probably won't though. Hope it helps!
I have 1 query and result display as following table:
ID
ProductsName
Suppliers
001
Pencil_1
ABC
001
Pencil_2
ABC
002
Ruler
XYZ
I want to combine ProductsName and Suppliers columns for duplicate ID and separate by comma, if the column has same result like Suppliers for ID=001, it will display once as following table:
ID
ProductsName
Suppliers
001
Pencil_1, Pencil_2
ABC
002
Ruler
XYZ
Please guide me how to solve it.
Thanks in advanced.
1) you can have query to only select distinct supplier
2) select all ProductsName and concat them for the given supplier