0

Use case is fairly straightforward. In postgres I can aggregate values from a GROUP BY into an array:

select
  customer,
  array_agg(product_name) as items
from transactions
group by customer

customer      items
-----------------------------------------------------------
john          [salad, pizza, beer, diapers, pasta, cheese]
joe           [cheese, beef, yoghurt, milk, water]

In Exasol, from the documentation page on aggregate functions, I can only see GROUP_CONCAT which merges all values from items above into a comma-separated string.

Is it possible to get these values in a proper array instead of in a string?

Jivan
  • 21,522
  • 15
  • 80
  • 131

1 Answers1

2

Could following help you where just concatenating the '[' and ']' characters

SELECT 
customer, concat('[',group_concat(product_name),']') as items 
FROM transactions group by customer;
Eralper
  • 6,461
  • 2
  • 21
  • 27