mirror of
https://github.com/agdsn/ancient-weatherstation.git
synced 2026-06-19 23:07:59 +00:00
heavy database optimizions
git-svn-id: file:///home/jan/tmp/wetterstation/trunk@243 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
@@ -126,7 +126,7 @@ class Wind{
|
||||
|
||||
/* liefert den Durchschnittswert in einem bestimmtem Interval */
|
||||
function _getAverage($interval){
|
||||
$avQuery = "SELECT avg(geschw) as average, count(geschw) as count FROM ".$this->table." WHERE sens_id=".$this->sensId." AND timestamp>(current_timestamp - INTERVAL '".$interval."')";
|
||||
$avQuery = "SELECT avg(geschw) as average, count(geschw) as count FROM ".$this->table." WHERE sens_id=".$this->sensId." AND timestamp>(select (current_timestamp - INTERVAL '".$interval."'))";
|
||||
$avData = $this->connection->fetchQueryResultLine($avQuery);
|
||||
return $avData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user