RE: Trouble with Average

2012-07-17 Thread Hal�sz S�ndor
2012/07/16 14:25 -0700, Rick James Here's a different way to smooth numbers. It uses an exponential moving average instead of the last 5. SELECT Time, @a := (9 * @a + Value) / 10 AS moving_avg FROM tbl JOIN ( SELECT @a := 0 ) AS x; Notes: * Make 10 larger or smaller, depending on

RE: Trouble with Average

2012-07-17 Thread Rick James
only the first few rows. -Original Message- From: Hal?sz S?ndor [mailto:h...@tbbs.net] Sent: Monday, July 16, 2012 8:25 PM To: mysql@lists.mysql.com Subject: RE: Trouble with Average 2012/07/16 14:25 -0700, Rick James Here's a different way to smooth numbers. It uses

RE: Trouble with Average

2012-07-16 Thread Rick James
* @a := 0 should be changed to some reasonable starting value, else the graph will be artificially low to start with. -Original Message- From: Hal?sz S?ndor [mailto:h...@tbbs.net] Sent: Monday, July 09, 2012 7:48 PM To: mysql@lists.mysql.com Subject: Re: Trouble with Average 2012/07

Re: Trouble with Average

2012-07-09 Thread Hal�sz S�ndor
2012/07/07 12:10 -0600, Albert Padley I have a log file that captures data from various sensors every minute that we use to draws graphs on our website. The table looks like this: CREATE TABLE `log` ( `id` int(14) NOT NULL auto_increment, `VarName` varchar(255) NOT NULL, `TimeString`