Not able to update custom field from Apex class, getting "Illegal assignment from List<AggregateResult> to List<Rating_Request__c>" error. can anyone help where I am doing wrong. If possible provide sample code. Below is my code : public void updateflgusertb(string Selected) { List<Rating_Request__c> usr = [SELECT ID,Question__c,Order_Sequence__c,User_Ratings__c FROM Rating_Request__c where User__c=:UserInfo.getUserId() and User_Rating__c = 0 group by ID,Question__c,Order_Sequence__c,User_Ratings__c order by Order_Sequence__c LIMIT 1]; List<Rating_Request__c> rateupdate = new List<Rating_Request__c>(); for(Rating_Request__c objrating : usr) { objrating.User_Ratings__c = Selected; rateupdate.add(objrating); } update(rateupdate); } Thanks in advance