title: Select most occurring values across few fields after GROUP BY in MYSQL
body: <p>Lets say I have a table with few fields, e.g. A, B, C, D</p>
  
  <p>I need to group by field A, and select most occuring values from B, C, D.</p>
  
  <p>Example:</p>
  
  <pre><code>+---+---+---+----+
  | A | B | C | D  |
  +---+---+---+----+
  | 1 | 3 | 5 | 15 |
  +---+---+---+----+
  | 1 | 5 | 6 | 32 |
  +---+---+---+----+
  | 1 | 5 | 6 | 34 |
  +---+---+---+----+
  | 2 | 7 | 5 | 50 |
  +---+---+---+----+
  | 2 | 8 | 1 | 32 |
  +---+---+---+----+
  </code></pre>
  
  <p>Expected result:</p>
  
  <pre><code>+---+---+---+----+
  | A | B | C | D  |
  +---+---+---+----+
  | 1 | 5 | 6 | 15 |
  +---+---+---+----+
  | 2 | 7 | 5 | 50 |
  +---+---+---+----+
  </code></pre>
  
  <p>I saw a lot of examples how to select most occurring value from one column by using COUNT(*) and than using MAX on top of that. But what to do in this case ?</p>