On Wed, Apr 04, 2012 at 12:05:44PM +0200, Steinar Midtskogen scratched on the 
wall:
> [Jean-Christophe Deschamps]
> 
> > You're going to have at most one random sample in every slice of 320
> > s.  The GROUP BY clause will select only one for you and the query can
> > be as simple as:
> >
> > select sample from from mytable group by timestamp / 320 order by
> > timestamp;
> 
> Ah.  I didn't think of that.  It's even better than getting every nth
> row, since I get one sample for a fixed period, which is what I really
> want.  And yet better, I suppose I could do something like SELECT
> min(sample), max(sample) FROM mytable GROUP BY timestamp / 3600 and
> use financebars or similar in gnuplot to avoid missing the extremes in
> the plot, making it appear more or less identical as if I had plotted
> every value.


  Not to mention avg().

  You might want to have a look at how RRDtool deals with condensing
  data.  It is common pratice to plot average, min, and max to preserve 
  outliers, while still showing trends.

  http://oss.oetiker.ch/rrdtool/


   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to