title: how to select column which is not in group by sentence in hive?
body: <p>There's a table <code>test</code> which has 3 columns: <code>id1, id2 ,id3</code> </p>
  
  <p>In MySQL, I can use</p>
  
  <pre><code>select id1, id2, id3 
  from test 
  group by id1, id2;
  </code></pre>
  
  <p>to get the different <code>id1, id2</code> and the first <code>id3</code> in every group. </p>
  
  <p>For example: the data in table test as follow</p>
  
  <pre><code>id1 id2 id3 
   1   1   1
   1   2   1
   1   2   2
   2   2   2
  </code></pre>
  
  <p>the result would be:</p>
  
  <pre><code>1 1 1
  1 2 1
  2 2 2
  </code></pre>
  
  <p>but in hive, there is an error   </p>
  
  <blockquote>
    <p>Expression not in GROUP BY key 'id3'</p>
  </blockquote>
  
  <p>What can I use in hive? I just want to group by id1,id2 and get the first row of id3 .</p>