Query that is based on results of another query

Hello guys
I was wondering if I can do query where the “where clause” is based on results of another query.

For example.
Issue a query using the find method on the Blog table and the where clause is
“Blog.poster.objId = (objId in (Users[following.objId= ‘xxxx’].objId))”

Here I am getting the posts made by the users that user xxx follows.

Thank yoi

Hello,
You can indeed use a subquery, but the outer comparison in your query isn’t correct: the (objId in (...)) returns a boolean value, and you’re comparing it to a string value of Blog.poster.objId.