Skip to content

Commit

Permalink
Update last tuple in period instead of first
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Jun 2, 2015
1 parent bc54bec commit 48a87c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion misc/tools/vzcompress2.php
Expand Up @@ -260,7 +260,7 @@ private function compressChannel($channel) {

// Step 2.1: Get new Value for timeframe
$newset = $this->sql_query(
"SELECT " . $interpreter::groupExprSQL("value") . " AS newval, COUNT(value) AS datapoints, MIN(id) AS updateid ".
"SELECT " . $interpreter::groupExprSQL("value") . " AS newval, COUNT(value) AS datapoints, MAX(id) AS updateid ".
"FROM data WHERE channel_id = ? AND timestamp > ? AND timestamp <= ?",
array($channel['id'], $lastcurtime, $curtime)
);
Expand Down

0 comments on commit 48a87c5

Please sign in to comment.