分页查询
from (bucket: "testdata" ) //buckets 数据库 |> range(start:2022-07-14T11:55:00Z, stop:2022-07-16T11:05:00Z) |> filter(fn: (r) => r._measurement == "Data_Info" and r.InfoGuid == "d339d9f2-5f5c-eb11-a223-98ac5e6c6524") |> pivot(rowKey: [ "_time" ], columnKey: [ "_field" ], valueColumn: "_value" ) |> group(columns: [ "Data_Info"], mode: "by") |> map(fn: (r) => ({r with _remaindervalue: float(v:(int(v: r._time)- int(v:r._start)))%180000000000.0})) |> filter(fn: (r) => r._ remaindervalue == 0 ) |> sort(columns: ["_time"], desc: true) |> limit(n:" + pagesize + ", offset: " + (page - 1) * pagesize + ") |> yield()
分组
group有个参数mode,2个值
by
: 默认值,根据前面的参数排序except
: 除了前面的参数,剩下的都参与group
from(bucket: "trial_bucket") |> range(start: -15m) |> filter(fn: (r) => r._measurement == "http_api_request_duration_seconds") |> group(columns: ["_time"]) |> mean() |> group(columns: ["_time", "_value"], mode: "except")
标签:group,time,influxdb,查询,语法,start,fn,._,columns From: https://www.cnblogs.com/xm123/p/18672699