1.

Will Below Query Work? Explain. select Count(id), Name, Address__c From Opportunity Group By Name

Answer»

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”.

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”.



Discussion

No Comment Found