title: How mysql works when using multiple columns on group by?
body: <p>Well how mysql works when using more than a column on group by like:</p>
  
  <pre><code>select
      a.nome,
      b.tb2_id,
      count(c.tb2_id) as saida
  from tb1 a
  left join tb2 b on a.tb1_id = b.tb1_id
  left join tb3 c on b.tb2_id = c.tb2_id
  group by a.tb1_id, b.tb2_id
  order by a.tb1_id desc
  </code></pre>
  
  <p>how mysql knows which column it will use to group the result set?</p>
  
  <p>i thought that it would do it in order but i changed the group by to 'b.tb2_id,a.tb1_id' but it doesn't make any change, same result.</p>