SOQL query to find Tasks by Subject and Count
We are trying to find tasks of the same Subject that occupy a lot of records. For example, there might be 4,000 tasks all titled “Opportunity closing in 3 days” and we want to find all instances where a single Subject is responsible for more than 1,000 records.
What I want to do is basically this:
SELECT subject
FROM Task
having count(subject) > 1000
But this results in a parsing error. Is my syntax just bad, it’s more complicated than that, or can this not actually be done?
Read more here: Source link
