In the first query, you want to retrieve:
- the page of the event creator,
- the page of the venue to this event.
What you get looks like:
{
"venue": {
"id": 421431217881031
},
"creator": 844413621
},
In the second query you get the information of the venue's page as such: WHERE page_id IN (SELECT venue.id FROM #events_info)
. This is very well done because you indeed need to look after the ID
of the venue into the venue
array.
In the third query, creator
is not an array anymore! It represents a page ID
(or a user's, but that's not a problem because they are going to be filtered). In that case, you can get the ID
directly:
WHERE page_id IN (SELECT creator FROM #events_info)
instead of
WHERE page_id IN (SELECT creator.id FROM #events_info)
.