An aggregate function cannot be used in this position
You have used an aggregate function outside of a SELECT expression, HAVING clause, or ORDER BY clause.
Move the use of the aggregate function to a permitted position.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.