porsager / postgres

Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare
The Unlicense
7.47k stars 273 forks source link

Merge data on multi join queries #643

Closed n0byk closed 1 year ago

n0byk commented 1 year ago

HI Can any one explain how to merge data on multi select queries like so

request

select * from users join groups on .... where user.id in(...)

responce

[
{
user: {
id: "",
name: ""
....
groups: [.....]
}
}
]

now we have a lot of rows

porsager commented 1 year ago

This is better suited as a regular sql query somewhere else, or try the matrix chat ;)