I'm trying to find the average figure for the last 10 rows in a database table:
select avg(Reading)
from Readings
Order By Rowid
desc limit 10;
This pulls the average of all entries in the table, not the last 10. I've tried all sorts of variations but can't get it to work.