Equivalent of PostgreSQL's array_agg in Oracle XE 11.2 [duplicate]
问题 This question already has answers here : SQL Query to concatenate column values from multiple rows in Oracle (11 answers) Closed 2 years ago . I have a Oracle 11g XE database and I have a query the result set: ID Category 1 Cat1 1 Cat2 2 Cat3 2 Cat4 I want to get distinct id's with all related categories in same row as comma separated like this ID Categories 1 Cat1,Cat2 2 Cat3,Cat4 I was using Postgres before and array_agg helped me there. How can I get same result in Oracle 11g XE? 回答1: