title: Google Spreadsheets: How to query countries with max population by continent?
body: <p>Let's say I have a table with the columns country, continent and population.</p>
  
  <p>How can I use the QUERY function in Google Spreadsheets to select, for each continent, only the country with the highest population?</p>
  
  <p>In regular SQL I think I'd use HAVING, but this doesn't seem to be an option here.</p>
  
  <p><a href="https://i.stack.imgur.com/tdLXwm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tdLXwm.png" alt="enter image description here"></a></p>