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

Aggregate SOQL Query Help



I am trying to get the number of ideas by status for th elogged in user. But i am getting the following error:


Error: Compile Error: unexpected token: 'where' at line 13 column 78

 public List<AggregateResult> IdeasSubmitted = new List<AggregateResult>();

IdeasUnderConsideration = [select count(id) from Idea group by status where CreatedById = '00530000003Xem5'];



Can anyone help me with this.


Thanks in advance

Best Answer chosen by Admin (Salesforce Developers) 

Hi, Try using the below query


select count(id) from Idea where CreatedById = '00530000003Xem5' group by status