title: oracle - getting highest values for each two type
body: <p>let's say this is the table "transcations" :</p>
  
  <pre class="lang-none prettyprint-override"><code>first_type      second_type     value
  m               t1              2
  a               t2              2
  a               t3              2
  b               t1              6
  g               t4              4
  b               t2              2
  r               t4              3
  m               t4              2
  g               t1              2
  b               t4              6
  a               t4              17 
  </code></pre>
  
  <p>how can i select the max value for each 'first_type' while showing associated 'second_type' column, the desired result is :</p>
  
  <pre class="lang-none prettyprint-override"><code>first_type      second_type     value
  m               t1              2
  b               t1              6
  g               t4              4
  r               t4              3
  m               t4              2
  b               t4              6
  a               t4              17 
  </code></pre>
  
  <p>or keeping just the highest value omitting other rows that have the same value for the 'first_type' column, like this :</p>
  
  <pre class="lang-none prettyprint-override"><code>first_type      second_type     value
  m               t1              2
  g               t4              4
  r               t4              3
  b               t4              6
  a               t4              17 
  </code></pre>
  
  <p>I tried to select the max value while grouping by 'first_type' but I can't select 'second type since Oracle does not permit selecting something not in the group clause.</p>