Ok thanks for this precision Merlin.
Seems like aggregates are way more powerful than I thought.
Obviously I need a lot more reading about custom aggregates before fully understanding it.
Elliot's query is pure SQL so obviously very cool !
It could be improved at the margin, and aggregates/function are certainly faster on big data.
But if you have no specific needs I would say Elliot is easier and more universal.
Cheers & thanks all for this good discussion.
Rémi-C