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.
--
Bernhard Graf
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/