I
I
Igor Vasiliev2021-09-22 13:53:23
SQL
Igor Vasiliev, 2021-09-22 13:53:23

How to nest json using SQL query?

Hello.
--
I didn't think that I would degrade like this after php frameworks, but I realized that I can't remember how to nest through SQL queries. Just flat join 2 or more tables, no problem, JOIN and UNION make it easy. By nesting I mean this:
614b0aabd48f3210275570.png
Can you show an example SQL query that does this nesting for json ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Akina, 2021-09-22
@Isolution666

DEMO
In general, nested subqueries or a chain of CTEs, each with its own level of aggregation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question