On 1 Dec 2009, at 8:06pm, npearson99 wrote: > So I could go select Avg(watts) from tblData where minute = 1 or minute =2 > or minute =3 or minute = 4
SELECT avg(watts) FROM tblData WHERE minute BETWEEN 1 AND 4 would be far faster, especially if you have an index on minute. > But then I would have to do another statement for the next row like this: > Avg(watts) from tblData where minute = 5 or minute = 6 or minute = 7 or > minute = 8. Sure. It's called writing software. > This would result in 2000 records with "smoothed" data out of a 8000 row > record set. > > My problem is that i need it to step every n number of rows (in this case 4) > to get to the next set of data. Work out a calculation you can do within SQLite which converts your minutes to one value for each four minutes. Perhaps some equivalent of int(minute/4) would do it. Then use this value for a GROUP BY clause. Simon. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

