Re: GROUP BY,
Yeah.. sometimes with group by you have to prepend DISTINCT to the
primary key to prevent duplicates. I can try to find a query example
if you really have never come across this. It's pretty common. I have
some hacks to do this, but if cake really supported grouping, I would
not be hacking anything.

Also,
I saw that INNER JOIN in the translation behavior. I tried to play
with that, but never got anything to work. That code is not a
relationship definition (as nate revealed will work in that posting)
but it is a query in array format. Normal cake usage does not have any
place where you build things like that.

Anyways...
Really thanks for the links. Very helpful to know.





On Feb 22, 9:17 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Re: INNER 
> JOINhttp://groups.google.com/group/cake-php/browse_thread/thread/9f092441...
>
> I believe the TranslateBehavior uses an INNER JOIN if you're looking
> for an example on how to dynamically change the binding although I
> haven't actually used this myself 
> yet.http://api.cakephp.org/1.2/translate_8php-source.html#l00070
>
> For GROUP BY I believe the norm is to use the conditions to pass in
> your group by 
> clause.https://trac.cakephp.org/browser/branches/1.2.x.x/cake/tests/cases/li...
>
> When has this not proved sufficient? Do you have a specific example?
>
> On Feb 21, 6: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
-~----------~----~----~----~------~----~------~--~---

Reply via email to