title: Partition by fixed number of records
body: <p>I like to know how I can partition a window by a fixed number of records.</p>
  
  <p>Example (<a href="http://sqlfiddle.com/#!1/7df86" rel="nofollow">http://sqlfiddle.com/#!1/7df86</a>).</p>
  
  <pre><code>CREATE TABLE Games 
  (
   id serial primary key, 
   game_no integer not null, 
   points integer,
    constraint game_no unique (game_no)
  );
  
  INSERT INTO Games (game_no, points)
  VALUES (3123, 5), (3126, 5), (3135, 8), (3128, null), (3130, 1), (3121, 11), 
  (3132, 0), (3133, 4), (3110, 7), (3112, null), (3113, 12), (3125, 3),(3134, 8);
  </code></pre>
  
  <p>I want the sum of the points of three games combined, starting with the highest game number, descending ordered by the game number. Like this.</p>
  
  <pre><code>| GAME_NO | POINTS | SUM_THREE |
  |---------|--------|-----------|
  |    3135 |      8 |        20 |
  |    3134 |      8 |        20 |
  |    3133 |      4 |        20 |
  |    3132 |      0 |         1 |
  |    3130 |      1 |         1 |
  |    3128 | (null) |         1 |
  |    3126 |      5 |        13 |
  |    3125 |      3 |        13 |
  |    3123 |      5 |        13 |
  |    3121 |     11 |        23 |
  |    3113 |     12 |        23 |
  |    3112 | (null) |        23 |
  |    3110 |      7 |         7 |
  </code></pre>
  
  <p>How to accomplish this with a window function without using a subquery? I also can't use for example a with statement. It has to be one single query because of the external parser that will execute it (and I have no control over). It seems so simple and I'm breaking my head over it the last couple of days:)</p>