* Matt S Trout <[EMAIL PROTECTED]> [2007-06-21 19:55]:
> On Thu, Jun 21, 2007 at 10:09:40AM +0200, Daniel McBrearty wrote:
> > If I have two tables, say A and B,  that have a many-to-many
> > relationship, implemented in the usual way with a join table
> > A_B - how can I economically find rows in table A whose id's
> > are not in A_B at all (i.e. they have zero instances of B
> > associated)?
> 
> group_by => 'a_b.a_id', having => \"COUNT(a_b.a_id) = 0"
> 
> ?

NB.: in SQL I’d use a straightforward subselect for that:

    SELECT x,y,z FROM a WHERE a.id NOT IN (SELECT a_id FROM a_b)

Is that expressible in DBIC?

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

_______________________________________________
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]/

Reply via email to