Problem with AND and OR on a join with Valentina (Director?)

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Mar 12 09:58:51 CST 2004


On 3/12/04 6:09 AM, "Leto Muaddib" <letomuaddib at yahoo.com> wrote:

> Now let's do another simple query:
> 
> SELECT * FROM t, k WHERE
> t.tID = k.tID 
> AND t.name = 't 4' OR k.Kwd = 2
> 
> Uhm, this is weird, it returns only one record from
> the join, the one with k.Kwd = 2.

Hi Leto,

OR between fields from different tables not works.

You can get the same result using
        fld IN (subselect)


    SELECT * FROM t
    WHERE t.name = 4 and t.ID in (SELECT ID FROM k WHERE Kwd = 2)


-- 
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