I've also had to do this before. I resort back to findAll for GROUP BY. I would just do a "1=1 GROUP BY...". Today i've run into a similar problem by having to use a HAVING and GROUP_CONCAT. It's much easier to use custom queries for this, as long as you clean your own data.
I also wish to know how to do this without breaking cake conventions. On Feb 21, 7:51 pm, rtconner <[EMAIL PROTECTED]> wrote: > I have no found a good way to do GROUP BY queries or INNER JOIN's in > cake. > Was wondering if any of you have come across these and how you handled > them. I have not been able to do either of them in conjunction with > the find() method in any normal way.Perhaps I am missing something? > I'd love to find out if I am. Are these some sort of database specific > constructs? > > With Group by, sometimes I can get away with appending $conditions[] = > 'GROUP BY field'; annd the in addition to that, manually passing in > the fields to find() and prepending DISTINCT to the id column. > > Inner Join I have seen zero support from in Cake. Any time I've wanted > to Inner join I've had to write the query manually. You know, > sometimes you just need to filter your queries based on two tables, > not just your primary table. > > Any help on these issues would be greatly appreaciated. I know I am > not the only one who has had trouble with them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
