title: Google BigQuery max() return wrong result
body: <p>In standard SQL dialect I ran the following query to return to a max, however, the result returns is wrong (see screenshot below). Explanation?</p>
  
  <pre><code>SELECT
    oi.customer_ead_to,
    MAX(oi.customer_ead_to) OVER (PARTITION BY oi.order_id) max_customer_ead_to
  FROM `rawData.order` o,
  UNNEST (items) oi
  WHERE oi.order_id = 3689393
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/5blsw.png" rel="nofollow noreferrer">Screenshot: The query returns a wrong Max of 5</a></p>