[Dbix-class] JOIN question
Anthony Hinsinger
anthony.hinsinger at univ-pau.fr
Mon Nov 27 09:20:51 GMT 2006
Hello,
I've the same problem, and I think the only solution to resolve it is to
modify the code. DBIC (i think) assumes that join conditions are all
based on the '=' operator. For DBMS, join condition is an expression
resulting in a value of type boolean.
Anthony
Le lundi 27 novembre 2006 à 09:05 +0100, Bernhard Graf a écrit :
> Matt S Trout wrote:
>
> > > SELECT me.title
> > > FROM email me
> > > LEFT JOIN chunk chunks ON chunks.email=me.id
> > > LEFT JOIN chunk chunks_2 ON chunks_2.email=me.id AND chunks.id!=chunks_2.id
> >
> > why not just join => [ qw/chunks chunks/ ] and add { 'chunks.id' =>
> > \"!= chunks_2.id" } to the where?
>
> Thanks for the answer, but this must be in the JOIN ... (ON ...) part to
> work correctly.
>
> I tried to put it into the from-attribute
>
> $attribute->{from} = [
> {me => 'email', -join_type => 'left'},
> [
> {chunks_2 => 'chunk'},
> {'chunks_2.email' => 'me.id', 'chunks.id' => \'!=chunks_2.id'}
> ]
> ];
>
> and failed with a similar error as before:
>
> FROM email me JOIN chunck chunks_2 ON ( chunks.id = SCALAR(0x2e06800)...
>
> moreover the -join_type setting is ignored.
--
Anthony Hinsinger <anthony.hinsinger at univ-pau.fr>
More information about the Dbix-class
mailing list