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
AnicheAniche 

SOQL help!

Hi,
 
I have a small problem in SOQL query that i am writing.
I am setting the value of a variable in a trigger and want to use the variable in the SOQL "Where" clause.
 
Example
 
String Grp_Id = new[0].ParentId;
 
Interger count  = [ Select count() from Account a where a.ParentID = Grp_Id]; 
 
How do i define Grp_Id in SOQL so that during run time it will pickup the value that it will get .
I have tried  +Grp_Id , '+ Grp_Id ' but all in vain.
 
Thanks
SuperfellSuperfell
Interger count = [ Select count() from Account a where a.ParentID = :Grp_Id];
AnicheAniche
Thanks Simon...