[Dbix-class] Filtering with Many-to-Many relationship

Wallace Reis reis.wallace at gmail.com
Tue Sep 22 12:57:48 GMT 2009


On Sat, Sep 19, 2009 at 3:23 PM, Wallace Reis <reis.wallace at gmail.com> wrote:
> On Sat, Sep 19, 2009 at 2:16 PM, Shawn Marincas
> <shawngmarincas at gmail.com> wrote:
>> It seems that the above query won't work in any case since searching for
>> tag_id IN a set will still returned the results OR'd together, and I need
>> the set of products which contain BOTH tags.  I've been toying with it some
>> more and came up with a solution which uses a subquery, still not sure if
>> this is the optimum solution yet or not.
>
> Right. You need of a query using XOR op in WHERE clause plus DISTINCT clause.

Hmm. Sorry, that won't work for your case.

-- 
     wallace reis/wreis         Catalyst and DBIx::Class consultancy with a clue
     Software Engineer		and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
 http://www.shadowcat.co.uk     http://www.linkedin.com/in/wallacereis



More information about the DBIx-Class mailing list