[V4MD] OR query results

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Dec 20 20:27:15 CST 2003


on 12/20/03 8:06 PM, Martin Kloss at martin.kloss at gmx.de wrote:

> At 16:24 20.12.2003, you wrote:
>>> So I think comparing fields in different tables in a condition when you're
>>> doing a join does not work in any case (AND / OR). Is that a limitation
>> that
>>> will also be in 2.0?
>> 
>> AND works 100%
>> 
>>     WHERE a.id = b.ptr
>>         AND a.f1 = 5
>>         AND a.f5 > 8
> 
> Sorry, my fault. I meant the combination of alternating AND / OR
> conditions over different fields does not work:
> 
> WHERE (a.f1 = 5 OR a.f2 = 2) AND (b.f1 = 3 OR b.f2 = 7)

Martin, this ALSO must works.

    (a.f1 = 5 OR a.f2 = 2)  => build selection on first table.

    (b.f1 = 3 OR b.f2 = 7)  => build selection on second table.

Then using this 2 selections I do JOIN.
JOIN is AND between these 2 conditions.

Again,

This should work.

 WHERE (a.f1 = 5 OR a.f2 = 2) AND (b.f1 = 3 OR b.f2 = 7)

This not in 1.x

 WHERE (a.f1 = 5 OR a.f2 = 2) OR (b.f1 = 3 OR b.f2 = 7)


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list