Using groupy by to get the first object

Hello,

Do you know if is possible using group by to get the first object of a grouping expression?

I need to do something such:

SELECT operator, COUNT(*) as count
FROM DOCUMENTS d
GROUP BY operator
SORT BY count desc

I need to receive the operator object which appears most frequently in my documents, not only the count.
How this could be accomplished by Bubble?

I’m doing this:

  • search by documents
  • :groupedby operator (count)
  • sort by count desc (yes)
  • :first item’s operator

but i’m getting an error because the group function only returns the count.

Thank you very much.

Best regards,
Rogerio