title: Translate MySQL query to BigQuery query
body: <p>I am having trouble converting MySQL query to Google Bigquery query. This is my MySQL query</p>
  
  <pre><code>SELECT id
  FROM office_details
  GROUP BY address
  HAVING max(value)
  ORDER BY id
  </code></pre>
  
  <p>This query runs perfectly on phpMyAdmin and with my php script. But when I convert it to bigquery</p>
  
  <pre><code>SELECT id
  FROM Office_db.office_details
  GROUP BY address
  HAVING max(value)
  ORDER BY id
  </code></pre>
  
  <p>It says column <code>id</code> is not in group by nor aggregated.</p>
  
  <p>What I need is the <code>id</code>s of unique <code>address</code> where <code>value</code> is maximum. e.g</p>
  
  <pre><code>+-------------------------+
  | id  |  address |  value |
  +-------------------------+
  | 1   |    a     |   4    |
  | 2   |    a     |   3    |
  | 3   |    b     |   2    |
  | 4   |    b     |   2    |
  +-------------------------+
  </code></pre>
  
  <p>I need</p>
  
  <pre><code>+----+
  | id |
  +----+
  | 1  |
  | 3  |
  +----+
  </code></pre>