I have a requirement where I need to display top records from an object instead of all that meets the criteria. Below is my SOQL
SELECT CustomAccount__r.Name, CustomAccount__r.Country__c, Month__c, Account_Range__c FROM Custom_Month__c WHERE Account_Range__c != 0 AND CustomAccount__r.UpDate__c = TRUE AND Date__c >= LAST_MONTH
When I tried to group the query using Name, Account_Range__c and Month__c, I am recieving the error as
MALFORMED_QUERY: duplicate alias: Name
Can anyone help me out on this to display only top records of an account instead of multiple records?