+ Start a Discussion
sravusravu 

Aggregate SOQL Query Help

Hi,

 

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) 
sfdeveloper9sfdeveloper9

Hi, Try using the below query

 

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