ZCatalog: searching where on index == another index
Hi all, 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 I know I can get all the unique values for field1 and then do a search for records where field2 = [unique field1 values], but isn't there a better way? Etienne
--On 21. Oktober 2005 13:00:35 +0200 Etienne Labuschagne <elabuschagne@agileworks.net> wrote:
Hi all,
Is there a way to search for all the records where one indexed field equals another indexed field?
no. -aj
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
participants (3)
-
Andreas Jung -
Dieter Maurer -
Etienne Labuschagne