diff --git a/server.js b/server.js index 6533548..46cdad4 100644 --- a/server.js +++ b/server.js @@ -65,7 +65,7 @@ app.get('/', function(req, res){ var devIndexQry = "select coreId, coreName, locationDesc, max(published_at) as MaxPub, max(status) as MaxStatus " + "from Alerts otbl " + - "where published_at = (select max(published_at) from Alerts where coreId = otbl.coreId) " + + "where published_at = (select min(published_at) from Alerts where coreId = otbl.coreId) " + "group by coreId, coreName, locationDesc;"; db.all(devIndexQry, function(err, rows){ if(err !== null) {