MySQL Forums
Forum List  »  Certification

Using ALL, ANY and SOME - question
Posted by: Luchezar Balev
Date: May 11, 2007 01:41AM

Hello all!

These guys like Paul DuBois and all the other MySQL guys seem so cool and clever to me that if they say something wrong they make me believe that I'm very stupid. No kidding. So please, explain to me.

In MySQL docs it is written:

The word ALL, which must follow a comparison operator, means “return TRUE if the comparison is TRUE for ALL of the values in the column that the subquery returns.” For example:


Ok, now back to the guide, 13.4.1. Using ALL, ANY, and SOME

There I've read something about the difference between ANY and ALL:

mysql> SELECT Name
-> FROM Country
-> WHERE Continent = 'Europe'
-> AND Code = ALL (SELECT CountryCode
-> FROM CountryLanguage
-> WHERE Language = 'Spanish')
-> ORDER BY Name;

Empty set (0.00 sec)

Because the result is empty, we can conclude that the
European continent is not the only one where Spanish is

Ups, I do not understand this... If more than one country speaks Spanish, this will always return an empty set, won't it?
OK, even more - if we remove Continent = 'Europe', we have an empty set again. Does it mean that 'because the result is empty, we can conclude that our world is not the only one where Spanish is spoken'?

Thanks in advance.
Best regards!

Options: ReplyQuote

Written By
Using ALL, ANY and SOME - question
May 11, 2007 01:41AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.