Why is 2 invalid? Could you please explain a little bit more about it?
SELECT clause can select only
single-valued expression.
Since lineItem*s* is a Collection and hence multi valued, it cannot be selected.
You have to use the IN operator to first select each of the collection constituents into a different variable (l) which can be selected since it represents a single lineItem in the lineItems collection. So 1) is correct and 2) is not. Does that help?
While 3 will return all lineitems existing in the database.
Oh Ok. I assumed that Line items can exist only for an Order.
If that is not the case, then 1 & 3 are not the same as you have correctly pointed out.