[Cologne-pm] DBIx::Class joins?!?

ReneeB mailinglisten at renee-baecker.de
Wed Jul 4 11:36:13 PDT 2007


ungetestet:
>
> oder als Join formuliert:
>
>     SELECT cd.title FROM cd
>         JOIN map ON map.cd = cd.id
>         JOIN genre ON map.genre = genre.id AND genre.name = 'Techno'
>         WHERE cd.year = 1995;
>
>
>   

    my @all_titles = $schema->resultset( 'CD' )->search(
        {
                'genre.name'     => 'Techno',
                'me.year'  => '1995',
         },
        {join     => [qw/map genre/],}
    )->all;

    print $_->title,"\n" for @all_titles;
>
> Blaeh!
>
>   


-- 
*) $foo - Perl-Magazin: http://foo-magazin.de
*) my Perl-Blog: http://reneeb-perlblog.blogspot.com



More information about the Cologne-pm mailing list