You need to sign in to do that
Don't have an account?

My count function is returning blank in SOQL
hi
i am stuck at very basic thing
if i am writing any query related to count i get null in count field
for example
select leadsource, count(id) Ce from lead group by leadsource
returns
Leadsource Ce
web ----
Phone ---
where it should retrun count number
same with any other query
select Count(id) from account
or
SELECT COUNT(Id), COUNT(CampaignId)
FROM Opportunity
all blank no count numbers
please help
HI,
No need of select count(id) from account. Just
Integer i = [select count() from account];
It will return the number of records in account
Swati is correct.
use just "count()".