I expect that my intuition is incorrect about the use of ALL() and ANY(), but I
found my result to
be reverse from what I expected.
Can anyone explain why ANY() behaves that way it does?
Here are two test case examples that do what I expect:
-- find all parent that only have boys
SELECT *
Richard Broersma Jr wrote:
Here is the example that doesn't do what I expect:
--find all parents that have a mixture of boys and girls.
--but this doesn't return anything
SELECT *
FROM Parents AS P
WHERE 'girl' ALL ( SELECT gender
FROM Children AS C1
Richard Broersma Jr wrote:
Here is the example that doesn't do what I expect:
I'm guessing you're just stood too close to the problem.
--find all parents that have a mixture of boys and girls.
--but this doesn't return anything
SELECT *
FROM Parents AS P
WHERE 'girl' ALL ( SELECT gender
On Oct 10, 2007, at 12:38 PM, Richard Broersma Jr wrote:
I expect that my intuition is incorrect about the use of ALL() and
ANY(), but I found my result to
be reverse from what I expected.
Can anyone explain why ANY() behaves that way it does?
Here are two test case examples that do what
Richard Broersma Jr [EMAIL PROTECTED] writes:
Can anyone explain why ANY() behaves that way it does?
Aside from the responses already given, I'm wondering whether you have
any NULL entries in Children.gender. NULL rows within a NOT IN
subselect tend to produce confusing results ...
--- John D. Burger [EMAIL PROTECTED] wrote:
I read this as: Find all parents such that none of their kids are
girls and none of their kids are boys. That is, ALL of their genders
are 'girl', AND ALL of their genders are 'boy'. Under the
obvious assumptions about gender, the result is