Here's a toy example:
CREATE TABLE MY_TABLE (ID INT, NAME VARCHAR);
INSERT INTO MY_TABLE VALUES(1, 'a');
INSERT INTO MY_TABLE VALUES(2, 'a');
INSERT INTO MY_TABLE VALUES(3, 'b');
INSERT INTO MY_TABLE VALUES(4, 'b');
SELECT ARRAY_AGG(IDS) AS IDS FROM
(SELECT ARRAY_AGG(ID) AS IDS FROM MY_TABLE GROUP BY NAME)
This will return [[1, 2], [3, 4]]. What I'd like is a way to flatten the inner arrays so that I end up with a single array, like [1, 2, 3, 4]. Is this possible in H2? (In a way that would would work for an arbitrary number of array elements).
Thank you.