function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tarique ShamsiTarique Shamsi 

Which SOQL query successfully returns the Accounts grouped by name?

Which SOQL query successfully returns the Accounts grouped by name? 

A. SELECT Id, Type, Max(CreatedDate) FROM Account GROUP BY Name 
B. SELECT Name, Max(CreatedDate) FROM Account GROUP BY Name 
C. SELECT Type, Name, Max(CreatedDate) FROM Account GROUP BY Name LIMIT 5 
D. SELECT Type, Max(CreatedDate) FROM Account GROUP BY Name
Best Answer chosen by Tarique Shamsi
Mario PariseMario Parise
B

They all group by name, but B and C are the only ones that actually query the Name field in the first place, and C introduces a limit of 5.