I did a load of different take son this query but finally found one
that seems to work for me.
$ret = $this->Image->findAll('GROUP BY User.id','DISTINCT
Post.*,User.*','User.name ASC,Post.rating DESC',20);
This will return the top-rated Post for the 20 first Users, ordered by
their name. The format returned is the same as for any plain findAll().
(You may find the query a bit useless...The model-names are made up
since my real models relate to entirely different data that would
require a lot more explanation)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---