TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

SQL Tip: JSONB_AGG in PostgreSQL for simple one-to-many joins

16 pointsby geekuillaumealmost 7 years ago

3 comments

sven_nalmost 7 years ago
I&#x27;m doing this even more extreme... querying a whole complex object graph based on an entity framework core model :) <a href="https:&#x2F;&#x2F;github.com&#x2F;MUnique&#x2F;OpenMU&#x2F;blob&#x2F;master&#x2F;src&#x2F;Persistence&#x2F;EntityFramework&#x2F;Json&#x2F;JsonQueryBuilder.cs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;MUnique&#x2F;OpenMU&#x2F;blob&#x2F;master&#x2F;src&#x2F;Persistenc...</a>
tbrugzalmost 7 years ago
Oracle has cursor expressions that returns a resultset inside a cell from the parent resultset. The whole resultset could then be serialized to json, xml or whatever<p>I wish there was an equivalent function in PostgreSQL. I&#x27;ve even asked a question about that on stackoverflow:<p><a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;8637050&#x2F;cursor-inside-sql-query" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;8637050&#x2F;cursor-inside-sq...</a>
zykranalmost 7 years ago
Nice !