From 71709a800f9eb564ecac829ffa0e5589ca4d30c1 Mon Sep 17 00:00:00 2001 From: Ace Date: Thu, 11 Aug 2016 11:13:04 +0530 Subject: [PATCH] Adding group by function when retrieving operations --- .../core/operation/mgt/dao/impl/GenericOperationDAOImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java index f523b22f64..033270636a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java @@ -381,7 +381,7 @@ public class GenericOperationDAOImpl implements OperationDAO { "LEFT OUTER JOIN (SELECT ID, ENROLMENT_ID, OPERATION_ID, OPERATION_RESPONSE, " + "MAX(RECEIVED_TIMESTAMP) LATEST_RECEIVED_TIMESTAMP FROM DM_DEVICE_OPERATION_RESPONSE " + "GROUP BY ENROLMENT_ID, OPERATION_ID) orsp ON o.ID = orsp.OPERATION_ID AND " + - "feom.ENROLMENT_ID = orsp.ENROLMENT_ID"; + "feom.ENROLMENT_ID = orsp.ENROLMENT_ID ORDER BY feom.OPERATION_ID"; stmt = conn.prepareStatement(sql);