Loading section...

Aggregate modifiers (ORDER BY)

Controlling Order By default, aggregated values have no guaranteed order. Modifiers give you precise control over sequencing. ORDER BY in Aggregates Time-Ordered Arrays The array preserves the sequence with most recent activity first. Downstream code can iterate through these events in order. Removing Duplicates DISTINCT in Aggregates ORDER BY + DISTINCT You can use both modifiers together: This gives you unique categories in alphabetical order for each customer.