title: BigQuery: Return First Value from Different Groups in a Group By
body: <p>I am currently having a problem with a Standard SQL query. I have a list of emails where every email can have multiple functions. See the example below on how the table looks like.</p>
  
  <pre><code>Email                         Function
  peter@gmail.com               engineer
  peter@gmail.com               specialist
  dave@gmail.com                analyst
  dave@gmail.com                tester
  dave@gmail.com                manager
  michael@gmail.com             intern
  </code></pre>
  
  <p>What I want is a query that returns every email once with the first function it finds. So the above table should return the following:</p>
  
  <pre><code>Email                         Function
  peter@gmail.com               engineer
  dave@gmail.com                analyst
  michael@gmail.com             intern
  </code></pre>
  
  <p>How do I do this?</p>
  
  <p>What I have right now is a simplified version of the query.</p>
  
  <pre><code>SELECT Email, Function
  FROM database
  GROUP BY Email, Function
  </code></pre>
  
  <p>The issue is here is that I have to put both Email and Function in the GROUP BY. If I only put Email in the Group By the query cannot run even though I only want the query to GROUP BY Email.</p>
  
  <p>Thanks!</p>