From d7661b0457fcc4ed4e7969d993f39e05ec956c97 Mon Sep 17 00:00:00 2001 From: kennyboy55 Date: Tue, 11 Apr 2017 11:35:08 +0200 Subject: [PATCH] Added name for time --- mean-app/server/routes/webapi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mean-app/server/routes/webapi.js b/mean-app/server/routes/webapi.js index 813ce22..dbd2ff2 100644 --- a/mean-app/server/routes/webapi.js +++ b/mean-app/server/routes/webapi.js @@ -160,7 +160,7 @@ router.get('/data/:device/group/:group', function(req, res) { console.log("Calculating group ", groupdiv); connection.query( - 'SET @i:=0; SELECT MIN(grp.`time`), AVG(grp.`HOV`) as HOV, AVG(grp.`HTV`) as HTV FROM (SELECT @i:=@i+1 AS `rownum`, FLOOR(@i/?) AS `datagrp`, `time`, `HOV`, `HTV` FROM `measurement` WHERE `device` = ? ORDER BY `time` DESC ) grp GROUP BY `datagrp`', [groupdiv, devid], + 'SET @i:=0; SELECT MIN(grp.`time`) as `time`, AVG(grp.`HOV`) as HOV, AVG(grp.`HTV`) as HTV FROM (SELECT @i:=@i+1 AS `rownum`, FLOOR(@i/?) AS `datagrp`, `time`, `HOV`, `HTV` FROM `measurement` WHERE `device` = ? ORDER BY `time` DESC ) grp GROUP BY `datagrp`', [groupdiv, devid], function (error, results, fields) { if (error) throw error;