vote

Are you a smart person who loves to communicate with people? If yes, then join us as a Business Development Executive.

countQuery(String str)

 Returns the number of records that a dynamic SOQL query would return when executed.

Integer i = Database.countQuery(‘select count() from account’);

System.debug(i);

Note: countQuery will not work if we enter any field inside the count.

count() // ok

count(ID) // error

Our Recent Blog

Share This Post