I'm reading documentation about OR operator, it says:
Most of the better DBMS will not even evaluate the second condition in an OR WHERE clausule if the first condition allready been met. (If the first condition is met, the row would be retrieved regardless the second condition).
SELECT prod_code, prod_price
FROM Articles
WHERE Code = '1' OR Code = '2'
Does this mean by documentation if Code = '1' query will return all values with '1' ignoring second condition WHERE Code = '2'.
I've tested this on SQL Server and it returns all values with 1 and all values with 2, so actually 2 rows.
So I'm bit confused here.
Code = 1then it won't evaluate the clauseCode = 2for that row. That doesn't mean it stops checking the rest of the rows. The RDBMS will still return every row that fulfils either of those requirements.colA = 'foo' or colB between 1 and 5