Skip to content
Advertisement

Fill Array from another column SQL

I need help whit my Code (PostgreSQL).

I get in my row Result {{2.0,10}{2.0,10}} but I want {{2.0,10}{3.0,20}}. I don’t know where my error is. Result is text [ ] its must be a 2D Array

This is Table1

Nummer Name Result
01 Kevin

This is Table2

Nummer Exam ProfNr
01 2.0 10
01 3.0 20

My Code is

Advertisement

Answer

You need to aggregate rows to make this happen. This CTE should help clarify what I mean:

Working fiddle

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement