How do you find a groupwise maximum, or the row containing the maximum value, in Doctrine? In SQL, I would typically do this using a self join as described here.
While it’s possible to set up a self relation in Doctrine, are there any better ways to do this?
Example of groupwise max:
Example of row containing maximum:
These are probably not the only ways (or most clean), but I just tested both and they work.