GROUP BY clause
Overview
You specify how Horizon AI Query should dissect the selected data through a Group By clause. The Aggregate expressions you specify would then be applied to the resulting groups.
Your Group By clause can contain one or more of the following expressions:
-
- A synchronous Query can have at most one Date Truncate expression
- A Continuous Query must have exactly one Date Truncate expression.
You can mix and match any expression types, and organize them in any order. Group Key Column expression tracks your declaration order.
Group by a truncated datetime
Group the input rows based on the specified column expression truncated to the specified granularity.
This is similar to the DATE_TRUNC
function in SQL.
Group by a date or time component
Group the input rows based on a specific date or time component extracted from the specified column expression.
This is similar to the DATE_PART
function in SQL.
Group by a Table Column expression
Group the input rows based on a Table Column expression.
This is similar to the generic GROUP BY
clause in SQL.
Group by a Source Column expression
Group the input rows based on a Source Column expression.
This is similar to a generic GROUP BY
clause in SQL.
If both the Provider and Source Type Source Columns are present in the Group By clause, the implicit Data Prioritization behaviour would be disabled.