231k views
2 votes
Explain the difference between COUNT() and COUNT(fieldname) in SOQL.

User Hamboy
by
8.1k points

1 Answer

2 votes

Final answer:

The difference between COUNT() and COUNT(fieldname) in SOQL explained

Step-by-step explanation:

The difference between COUNT() and COUNT(fieldname) in SOQL is as follows:


For example, if you have a 'Contacts' object and you use COUNT(), it will return the total number of contacts in the object. But if you use COUNT(Email), it will return the number of contacts where the 'Email' field is not null.

User PeaceLeka
by
7.5k points