title: equating an entry to an aggregated version of itself
body: <p>I am trying to find if an entry's value is the max of the grouped value.  Its purpose is to sit in a larger <code>if</code> logic.</p>
  
  <p>Which I'd expect would look something like this:</p>
  
  <pre><code>SELECT
      t.id as t_id, 
      sum(if(t.value = max(t.value), 1, 0)) AS is_max_value
  
  FROM dataset.table AS t
  GROUP BY t_id
  </code></pre>
  
  <p>The response is:</p>
  
  <pre><code>Error: Expression 't.value' is not present in the GROUP BY list
  </code></pre>
  
  <p>How should my code look to do this?</p>