I am amazed this question doesn't seem to have been asked before, but if so, my pretty exhaustive searches have not discovered it.
I have a simple ring buffer of temperatures in a column from which I want calculate the average value.
The sql table looks like this (column names shown in top row) ...
uid Temp
1 70
2 70
3 70
4 70
5 70
6 69
7 69
8 69
9 69
10 69
Every time I obtain a new temperature, I want to shift the "Temp" column up one row before writing the newest value into slot '10' so I can get the average value of the column data.
There must be a simple way to do this, that I haven't figured out yet. :-(