The Salesforce SQL, also known as SOQL, is limited in its query statements when trying to perform group by, limit, order by and other standard SQL statements. This is the reason that we download our Org's data to a local DB and then we can perform all the queries needed to perform such actions that you are trying to do
Anyway thanks for posting on my site and please do not hesitate to ask any kind of question that you have.
Best of luck
~Mike
|