[GENERAL] ALL( ... ) and ANY ( ... ) didn't behave as expected

2007-10-10 Thread Richard Broersma Jr
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 *

Re: [GENERAL] ALL( ... ) and ANY ( ... ) didn't behave as expected

2007-10-10 Thread John D. Burger
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

Re: [GENERAL] ALL( ... ) and ANY ( ... ) didn't behave as expected

2007-10-10 Thread Richard Huxton
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

Re: [GENERAL] ALL( ... ) and ANY ( ... ) didn't behave as expected

2007-10-10 Thread Erik Jones
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

Re: [GENERAL] ALL( ... ) and ANY ( ... ) didn't behave as expected

2007-10-10 Thread Tom Lane
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 ...

Re: [GENERAL] ALL( ... ) and ANY ( ... ) didn't behave as expected

2007-10-10 Thread Richard Broersma Jr
--- 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