SQL "OR"

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Feb 25 00:04:16 CST 2004


on 2/24/04 11:38 PM, Andrew Sinning at andrew at learningware.com wrote:

> I'm having a tough time understanding why my "OR" doesn't workin the
> following query:
> 
> SELECT qId FROM questions, answers WHERE stemText LIKE 'what' no_case
> 
> -- yeilds 16 results.  This is a expected
> 
> -- now, if I add an OR to the WHERE clause, I should expect at least 16
> results, correct?
> 
> 
> SELECT qId FROM questions, answers  WHERE stemText LIKE 'what' no_case
> OR answers.text LIKE 'what' no_case
> 
> -- yeilds 0 results

Hi Andrew,

Standard problem.
Not works in 1.x

You can get the same result using

    select 
    from questions
    WHERE 
        stemText LIKE 'what' no_case
    and  
        id in (SELECT ptr Answers WHERE text LIKE 'what' no_case)


You need correct id and ptr according to your links

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