I have the following sql tables enter image description here
enter image description here
Now I want to get all the data in a single query I am using Node.JS and I wrote the following query
SELECT * FROM person_table INNER JOIN event_table ON person_table.person_id = event_table.person_id
Now I get the following response enter image description here
but I want output as follows which is nested json format enter image description here
1.4m articles
1.4m replys
5 comments
56.9k users