title: Problem #5 in SQLZOO's "Window functions" tutorial
body: <p>I have been struggling with problem #5 of SQLZOO's "<a href="https://sqlzoo.net/wiki/Window_functions" rel="nofollow noreferrer">Window functions</a>" tutorial. The tutorial uses the table "ge," which includes general election results in the UK for 2015 and 2017. "ge" includes the fields yr, firstName, lastName, constituency, party, and votes. Problem #5 asks the learner to show the parties that won for each Edinburgh constituency in 2017. Earlier on, the tutorial notes that Edinburgh constituencies are numbered S14000021 to S14000026. Below is the query I wrote:</p>
  
  <pre><code>SELECT constituency, party
  FROM ge x
  WHERE constituency BETWEEN 'S14000021' AND 'S14000026'
  AND yr = 2017
  AND votes &gt; ALL
  (SELECT votes FROM ge y
  WHERE y.constituency = x.constituency
  AND y.party != x.party)
  GROUP BY constituency
  </code></pre>
  
  <p>My result is mostly correct, but omits constituencies S14000021 and S14000026. I wondered at first if BETWEEN might not be inclusive, but toying with that didn't solve the problem. Can anyone help me figure this out?</p>