The ALL operator returns True when all of the records in query result set pass the Boolean condition. A bit more explanation. The ALL statement gives a TRUE value when: 1) the subquery returns no records, or 2) all records meet the comparison. ALL will return false if even one record fails the Boolean condition. If any of the values are NULL, then the operation value will be NULL, not TRUE. For example, we want to see which authors currently have no titles: SELECT au_id FROM authors WHERE au_id <> ALL(SELECT au_id FROM titleauthor) Syntax SELECT … WHERE expression comparison … [Read more...]
BETWEEN operator
BETWEEN performs a Boolean True/False test to determine whether or not a value falls within a particular range, including the values mentioned in the BETWEEN clause. BETWEEN returns TRUE when in the range, FALSE when not in the range, and NULL if any range values are unknown. It can't be used with data type like BLOB, CLOB, NCLOB, REF, and ARRAY. Syntax SELECT … WHERE expression [NOT] BETWEEN bottom_of_range AND top_of_range Explained WHERE expression Compares an expression, that is, a single value like a column value or a literal expression, to the values … [Read more...]
ANY / SOME operators
The ANY and SOME operators, which are synonyms, perform a Boolean test returning true if even one record in the result set matches the Boolean condition. ANY/SOME is semantically equivalent to IN and EXISTS, but much less widespread. To ensure easy maintenance of your code, use IN or EXISTS rather than ANY/SOME wherever possible. A bit more explanation, ANY/SOME operators return TRUE when at least one record matches and return FALSE when none match or when there's an empty result set. If any of the values are NULL, then the operation value will be NULL, not TRUE. ANY/SOME can be used for … [Read more...]