MySQL Forums
Forum List  »  Performance

Re: Linear interpolation of MySQL data
Posted by: Rick James
Date: May 06, 2012 10:33PM

I would not even try to do it in SQL. Instead, I would use my application language (PHP, Perl, whatever) to do the work after doing something like
SELECT * FROM observations ORDER BY ...;
The app need only keep the two consecutive rows to do linear interpolation. (If you need something other than linear, then you may need to keep more than 2 rows.)

Part of the issue is that one gap in the data might map to zero output rows, or might map to many rows. That is really messy in SQL.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Linear interpolation of MySQL data
2671
May 06, 2012 10:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.