I am interested to create a query which includes a "subquery" and I want to limit the output of the subquery based on some criteria. Much more cleat with an example (The sample database can be found below):
The query I am using now is this:
Ok, I see your solution but I guess it does not work for my case which is much bigger than this simple db.
What I suspect is that probably I should not try to create one superpowerfull query and split the query in several little queries. Does it ...