title: MySQL world database Trying to avoid subquery
body: <p>I'm using the MySQL <a href="http://dev.mysql.com/doc/world-setup/en/world-setup.html" rel="nofollow noreferrer">WORLD</a> database.</p>
  
  <p>For each Continent, I want to return the Name of the country with the largest population.</p>
  
  <p>I was able to come up with a query that works.  Trying to find another query that uses join only and avoid the subquery.</p>
  
  <p><strong>Is there a way to write this query using JOIN?</strong></p>
  
  <pre><code>SELECT Continent, Name
  FROM Country c1
  WHERE Population &gt;= ALL (SELECT Population FROM Country c2 WHERE c1.continent = c2.continent);
  
  +---------------+----------------------------------------------+
  | Continent     | Nanme                                         |
  +---------------+----------------------------------------------+
  | Oceania       | Australia                                    |
  | South America | Brazil                                       |
  | Asia          | China                                        |
  | Africa        | Nigeria                                      |
  | Europe        | Russian Federation                           |
  | North America | United States                                |
  | Antarctica    | Antarctica                                   |
  | Antarctica    | Bouvet Island                                |
  | Antarctica    | South Georgia and the South Sandwich Islands |
  | Antarctica    | Heard Island and McDonald Islands            |
  | Antarctica    | French Southern territories                  |
  +---------------+----------------------------------------------+
  11 rows in set (0.14 sec)
  </code></pre>