title: MySQL: fill empty strings with any non-empty value in a group
body: <p>Here is a table <code>tests</code> (simplified):</p>
  <pre><code>-------------------------
  | id | test_name | unit |
  -------------------------
  | 1  | Voltage   | V    |
  | 2  | Current   |      |
  | 3  | Frequency | Hz   |
  | 4  | Voltage   | v    |
  | 5  | Voltage   |      |
  | 6  | Voltage   | V    |
  | 7  | Current   | A    |
  | 8  | Voltage   | V    |
  -------------------------
  </code></pre>
  <p>I need to fill the empty <code>unit</code> fields with any non-empty value in its group (by <code>test_name</code>), i.e. the unit for <code>Voltage</code> may be <code>V</code> or <code>v</code> and for <code>Current</code> it should be <code>A</code>. Is there a way to do it with <code>update ... join ... group by</code> or something similar?</p>