I have this Apex SOQL query:- Map<Id,AggregateResult> results=new Map<id,AggregateResult>([select accountid id,min(id),min(Partner_Admin_Sequence_Number__c) Integer from Contact where AccountId IN:deactconacctSet and Contact_Status__c ='Active' and (Partner_Admin_Sequence_Number__c !=null and Partner_Admin_Sequence_Number__c!=0) group by accountid]);
Map<Id, AggregateResult> results = new Map<Id, AggregateResult>([
select accountid id, min(id), min(Partner_Admin_Sequence_Number__c) Integer
from Contact
where AccountId IN:deactconacctSet and Contact_Status__c ='Active' and (Partner_Admin_Sequence_Number__c !=null and Partner_Admin_Sequence_Number__c!=0) group by accountid
]);