title: Mysql group by get value base of another colum value
body: <p>I have one long query return like below table</p>
  <pre><code>item_Id    name            value priority
  1        department         A      F
  1        department         B      T
  1        zone               12     F
  1        area             Africa   F
  2        department         A      F
  2        zone               12     F
  2        area              Africa  F
  2        area              Europe  T
  </code></pre>
  <p>Could I use group by to achieve below result</p>
  <pre><code>item_id   name            value
   1       department       B
   1       zone             12
   1       area            Africa
   2       department        A
   2       zone             12
   2       area             Europe
  </code></pre>
  <p>Basically, i would like to to group <code>name</code> , and the value is based on priority without join the query itself</p>