[Dbix-class] how to find rows that have 0 many-to-many rel's

Matt S Trout dbix-class at trout.me.uk
Thu Jun 21 18:47:25 GMT 2007


On Thu, Jun 21, 2007 at 10:09:40AM +0200, Daniel McBrearty wrote:
> Hi
> 
> 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"

?

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 



More information about the Dbix-class mailing list