TopOne (Azure Stream Analytics)
Updated: April 22, 2016
Applies To: Azure
Returns the top-rank record, where rank defines the ranking position of the event in the window according to the specified ordering. Ordering/ranking is based on event columns and can be specified in ORDER BY clause.
Syntax
TopOne() OVER (ORDER BY (<column name> [ASC |DESC])+)
column_name
Specifies the name of the column in the input event by which ordering will be done. Note that only ordering by bigint, float and datetime types are allowed.
Returns a record.
SELECT
TopOne() OVER (ORDER BY value DESC) as topEvent
FROM input
GROUP BY TumblingWindow(second, 10)
Show: