title: Rolling Average in Oracle SQL
body: <pre><code>LotNumber   Device  Measure MeasureDate RowNumber
  LotA        DevA    1.1     10/1/15 0:00    1
  LotA        DevA    1.2     10/1/15 1:00    1
  LotA        DevB    1.1     10/1/15 2:00    2
  LotB        DevA    1.3     10/1/15 3:00    3
  LotB        DevA    1.4     10/1/15 4:00    3
  LotA        DevA    1.2     10/1/15 5:00    4
  LotC        DevA    1.3     10/1/15 6:00    5
  LotD        DevA    1.5     10/1/15 7:00    6
  LotE        DevA    1.1     10/1/15 8:00    7
  LotF        DevA    1.2     10/1/15 9:00    8
  LotG        DevA    1.3     10/1/15 10:00   9
  LotH        DevA    1.4     10/1/15 11:00   10
  
  
  
  LotNumber   Device  Measure MeasureDate RowNumber   Rolling Average
  LotA        DevA    1.1     10/1/15 0:00    1       Measure Average of RowNumber 1-5
  LotA        DevB    1.1     10/1/15 2:00    2       Measure Average of RowNumber 2-6
  LotB        DevA    1.3     10/1/15 3:00    3       Measure Average of RowNumber 3-7
  LotA        DevA    1.2     10/1/15 5:00    4       Measure Average of RowNumber 4-8
  LotC        DevA    1.3     10/1/15 6:00    5       Measure Average of RowNumber 5-9
  LotD        DevA    1.5     10/1/15 7:00    6       Measure Average of RowNumber 6-10
  LotE        DevA    1.1     10/1/15 8:00    7       Measure Average of RowNumber 7-10
  LotF        DevA    1.2     10/1/15 9:00    8       Measure Average of RowNumber 8-10
  LotG        DevA    1.3     10/1/15 10:00   9       Measure Average of RowNumber 9-10
  LotH        DevA    1.4     10/1/15 11:00   10      Measure Average of RowNumber 10
  </code></pre>
  
  <p>Is it possible to have the second table? I have no idea how to do this. Rolling average of rownumber with intervals of 4. For example, Average of RowNumber 1-5 is the average of all Measure with Rownumber that is ranging from 1-5. Thanks!</p>