Aggregate. Returns the maximum value of a given expression over multiple rows.
DISTINCT is permitted, but has no effect because the maximum of the distinct values is the same as the maximum of all values.
The following example calculates the maximum value of the Price column over the last five minutes:
INSERT INTO OutStream SELECT MAX(Trades.Price) FROM Trades KEEP 5 MINUTES;