Will below query work?
Explain.
SELECT COUNT(Id), Name,
Address__c FROM Opportunity GROUP BY Name
Above query will throw an
error.
Explanation : In Group by
clause the columns selected must be either used in Group by clause or in
aggregate functions. The Name field is neither used in aggregate methods and in
group by clause and hence will result in error “Malformed Query”.
No comments:
Post a Comment