title: Divide a value by it's group max value in sql
body: <p>I have some data which looks like :</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Class</th>
  <th>Time</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>12</td>
  </tr>
  <tr>
  <td>1</td>
  <td>14</td>
  </tr>
  <tr>
  <td>2</td>
  <td>3</td>
  </tr>
  <tr>
  <td>1</td>
  <td>56</td>
  </tr>
  <tr>
  <td>3</td>
  <td>4</td>
  </tr>
  <tr>
  <td>5</td>
  <td>32</td>
  </tr>
  <tr>
  <td>...</td>
  <td>...</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>How to write a SQL query to find a average of a class score?</p>
  <p>Class score : (100 * Time) / max(Time of that class) [kind of a % but instead of total time of that class we will use max time of that class.]</p>
  <p>Expected result is :</p>
  <p><code>for 1 : avg( (12 * 100 / max(12, 14, 56)), (14 * 100 / max(12, 14, 56)), (56 * 100 / max(12, 14, 56)))</code></p>
  <p>same for all values</p>
  <p>Thanks in advance</p>