1.

Explain Difference In Count() And Count(fieldname) In Soql.?

Answer»

COUNT()

  • COUNT() must be the only element in the SELECT LIST.
  • You can USE COUNT() with a LIMIT clause.
  • You can’t use COUNT() with an ORDER BY clause. Use COUNT(fieldName) instead.
  • You can’t use COUNT() with a GROUP BY clause for API version 19.0 and LATER. Use COUNT(fieldName) instead.

COUNT(fieldName)

  • You can use COUNT(fieldName) with an ORDER BY clause.
  • You can use COUNT(fieldName) with a GROUP BY clause for API version 19.0 and later.

COUNT()

COUNT(fieldName)



Discussion

No Comment Found