I have the below Oracle SQL Query and it works fine
Select Cage.BARCODE Cg, CagePen.BARCODE Pen
FROM LOCATION_ENTITY CagePen
LEFT JOIN LOCATION_ENTITY Cage ON SUBSTR(CagePen.FULL_LOCATION, -6)=Cage.BARCODE
WHERE CagePen.FULL_LOCATION = 'Current'
I get the response back like
CG PEN
CGE100 CP4265
CGE100 CP4264
CGE101 CP4266
CGE101 CP4267
CGE102 CP4268
CGE102 CP4269
Now I am trying to consolidate the response where CG is repeated
CG PEN
CGE100 CP4265, CP4264
CGE101 CP4266, CP4267
CGE102 CP4268, CP4269
Should this query be using agg()