Skip to content
Advertisement

How unnest h2 table’s result

I have this field

 project_numbers text ARRAY

now in h2 want to select it

SELECT UNNEST(project_numbers) FROM PROJECTS 

but it doesn’t work

Advertisement

Answer

UNNEST in SQL is not a regular function, it is a collection derived table. You can use it in the FROM clause:

SELECT * FROM UNNEST((SELECT project_numbers FROM tableName WHERE someCondition));
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement