Difference between count() and count(fieldname) ?



Difference between count() and count(fieldname) ?..

Answer / Annu Kumar

The COUNT() function returns the total number of rows in a query result, while COUNT(fieldName) counts only non-null values for the specified field. Using COUNT(fieldName) can help you avoid counting empty or null fields when performing queries.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Salesforce Interview Questions

Can we create a dashboard using Visual-force page? and what all the components we use here?

1 Answers   Cap Gemini,


Explain apex code execution governors and limits?

1 Answers  


How can you create object relations in salesforce?

1 Answers  


What is collection in apex?

1 Answers  


How will you achieve pagination in SOQL?

1 Answers  


What is an apex transaction?

1 Answers  


What are the escalation rules?

1 Answers  


What is included with each standard controller? : salesforce visualforce

1 Answers  


What is a standard profile?

1 Answers  


How many types of assert statements are there and what is their purpose?

1 Answers  


What is mvc architecture in visualforce?

1 Answers  


What is field-level security in salesforce ?

1 Answers  


Categories