My Postgres version is 11.15. I have a table like:
The output I need is
|3||Carol, Bill, Anna|
|4||Dave, Carol, Bill, Anna|
|5||Tom, Dave, Carol, Bill, Anna|
I tried using LAG function of PostgreSQL but it only gives me last row value, could not find a way to get all previous rows, number of rows is dynamic and can be anywhere between 12 to 52 rows.
Can you please help me out?