Skip navigation links

MySQL Forums :: Certification :: Using ALL, ANY and SOME - question


Advanced Search

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:

SELECT s1 FROM t1 WHERE s1 > ALL (SELECT s1 FROM t2);
-----------------

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
spoken.
--------------------------------------------


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


Subject Written By Posted
Using ALL, ANY and SOME - question Luchezar Balev 05/11/2007 01:41AM
Re: Using ALL, ANY and SOME - question Bruno Verley 05/14/2007 03:39AM
Re: Using ALL, ANY and SOME - question Carsten Pedersen 05/15/2007 12:28PM


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.