You are on page 1of 1

Query Syntax Aggregate Functions Clauses

count() – number of events or non-null values limit – retrieve only the first n rows of a result
Grammar
select count(*), count(SessionId) select *
from stream
select [<expr> [as <label>],] where Environment = 'Production'
[from stream distinct() – unique values of an expression
limit 100
[where <expr>]
select distinct(StatusCode),
[group by [time(<duration>)|<expr>,]]
count(distinct(RequestPath))
[having <expr>]
[order by [time|<label>] [asc|desc]]
[limit <number>] first(), last() – first or last non-null value
[for refresh]] select first(Elapsed), last(Elapsed)

min(), max() – smallest or largest value


Grouping columns are always included in the
result set. select min(Elapsed), max(Elapsed)

mean() – the average of non-null values


Time Slicing select mean(CartSize) Switch to chart views with the selector on the
left below the query box.
Count by time slice names() – distinct available property names
Add a chart to a dashboard using the button to
select count(*) select names() the right of the query box.
from stream
group by time(15m) Save a query by clicking + next to the QUERIES
percentile() – the value at or below which a
certain percentage of values lie heading in the right-hand panel.
Count by time slice, grouped by property
select percentile(ResponseTime, 99) Learn more at https://docs.getseq.net/
select count(*)
from stream sum() – sum of an expression
group by MachineName, time(8h)
select sum(SaleTotal)
Time groupings accept durations in:
d – days, h – hours, m – minutes, s – seconds, top(), bottom() – first or last n values
ms – milliseconds, us – microseconds.
select top(Elapsed, 5), bottom(Item, 2)

Copyright © 2017 Datalust

You might also like