SQL "OR"

Francois Van Lerberghe fvanlerberghe at freegates.be
Tue Feb 24 23:21:26 CST 2004


le 24/02/04 22:38, Andrew Sinning <andrew at learningware.com> a écrit :

> 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

I think you must enclose condition by table into parenthesis

Try :

    SELECT qId FROM questions, answers  WHERE (stemText LIKE 'what' no_case)
OR (answers.text LIKE 'what' no_case)



François Van Lerberghe
Rue Thier Monty, 15 A
4570 Marchin
Belgique



More information about the Valentina mailing list