title: Why do I need to specify rows unbounded in this query?
body: <p>I'm doing SQL exercises at <a href="https://www.windowfunctions.com/questions/over/3" rel="nofollow noreferrer">WindowFunctions.com</a>. The task is to cumulatively sum cats' weights from heaviest to lightest. The table looks like:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>name</th>
  <th>weight</th>
  <th>...</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Ashes</td>
  <td>4.5</td>
  <td>...</td>
  </tr>
  <tr>
  <td>Tigger</td>
  <td>3.8</td>
  <td>...</td>
  </tr>
  <tr>
  <td>Smokey</td>
  <td>6.1</td>
  <td>...</td>
  </tr>
  <tr>
  <td>...</td>
  <td></td>
  <td></td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>My first guess was</p>
  <pre><code>SELECT 
  name,
  SUM(weight) OVER (ORDER BY weight DESC) AS running_total_weight
  FROM cats 
  </code></pre>
  <p>However, it produces wrong result which sums first two cats into first cumulative sum.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>name</th>
  <th>running_total_weight</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Smokey</td>
  <td>12.2</td>
  </tr>
  <tr>
  <td>Oscar</td>
  <td>12.2</td>
  </tr>
  <tr>
  <td>...</td>
  <td></td>
  </tr>
  <tr>
  <td>Tigger</td>
  <td>61.1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>If I, however, run the same query ascending, the summation is done correctly, and Tiger has weight 3.8 and not 8.0.</p>
  <p>The site suggests solution: rewrite <code>OVER ()</code> clause as <code>OVER (ORDER BY weight DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)</code>. Why does it works? Why is it needed when summation descending and not needed when descending?</p>