Hi,
I'm in the following situation: I have Invoices, Products and ProductEntries. In my simple application I want to display the Invoices along with the sum of their ProductEntries and be able to sort them. So I'll have to order it according to the SUM of the values of the entries. My problem is that I'm unable to get Invoices from a typical SELECT ... GROUP BY, because I've to obviously group by the unique identifier. And since I wanted to build a system which accepts custom Order objects, I wanted to avoid to fetch first the IDs and then the Invoices itself, meaning I want to have only a single step.
Is this even possible?
Thanks in advance, Daniel
|