Etienne Labuschagne wrote at 2005-10-21 13:00 +0200:
>Is there a way to search for all the records where one indexed field
>equals another indexed field?
>
>Equivalent SQL query would be:
>
>SELECT * FROM table WHERE field1 = field2

If the index has only a few different values,
enumerating them may be feasible.

With "AdvancedQuery", this could look like:

     from Products.AdvancedQuery import Or, Eq

     query = Or(*[Eq(I1,v) & Eq(I2,v) for v in I1.unique(Values)])

-- 
Dieter
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to