I have a table data like this:
I want to concatenate the data as below in postgresql:
I used query as below but there is a small problem:
select
Item,
array_to_string(array_agg(Component) ,', ') AS Component,
array_to_string(array_agg(Seller) ,', ') AS Seller
from tablename
group by Item
Its giving me below output:
For item A2, its showing C89 two times, I want to show only one time.
Please help me out!!


