Hi,

Anyone know of native support queries like:

SELECT * FROM artist a LEFT JOIN cd c *ON a.name = c.artist AND c.year = 2000*

Note the complex on clause.

This is basically a four year bump of this thread: http://dbix-class.35028.n2.nabble.com/Left-join-with-an-extra-condition-td3880896.html

Peter and Bill point out we can use a literal string:

from => \q{
artist me LEFT JOIN gig gigs
ONme.id <http://me.id/>= gigs.artist
AND gigs.venue = 'outside'
            },


but we'd loose joins and prefetch. I'd rather not create a view for these types of queries and just use a subselect or two queries.


Cheers

Brew
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to