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 f6f7e4b0cca..24e565f2d7e 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 @@ -425,7 +425,8 @@ public class GenericOperationDAOImpl implements OperationDAO { " LEFT JOIN " + " DM_DEVICE_OPERATION_RESPONSE opr ON opr.EN_OP_MAP_ID = eom.ID " + "WHERE " + - " eom.OPERATION_ID = ? AND eom.TENANT_ID = ?"; + " eom.OPERATION_ID = ? AND eom.TENANT_ID = ? " + + "ORDER BY eom.UPDATED_TIMESTAMP DESC"; stmt = conn.prepareStatement(sql); stmt.setInt(1, operationId);