SQL "OR"

Robert Brenstein rjb at rz.uni-potsdam.de
Tue Feb 24 23:03:30 CST 2004


>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

My guess is that stemText and text are in different tables. If so, 
this is a known problem: Valentina 1.x can't handle this properly -- 
it treats your "OR" as an "AND". I think you can use a join to remedy 
this but you may need to do some processing in your code.

Robert


More information about the Valentina mailing list