Help me understand this: In the sqlzoo tutorial for question 3a (“Find the largest country in each region”), why does attaching ‘AND population > 0’ to the nested SELECT statement make this correct?
Help me understand this: In the sqlzoo tutorial for question 3a (Find the largest
Share
The reason is because the:
…is filtering out the null row for the region “Europe”, name “Vatican”, which complicates the:
…because NULL isn’t a value, so Russia won’t be ranked properly. The ALL operator requires that the value you were comparing to be greater or equal to ALL the values returned from the subquery, which can never happen when there’s a NULL in there.
My query would’ve been either:
…or, using a JOIN: