InfluxDb3 help (Query, Grafana)

Hey, I’m having trouble adopting influxdb3 as a database for storing and querying time based data.
Currently I am trying with a table that has three fields:

  • timestamp
  • item
  • count

I want to do queries with Grafana to draw graph that has a line for each type of item.
for example. However, grafana likes data is wide, so it could for example have time stamp and then count values for each item.
I can’t seem to find any pivoting query with SQL that would be able to combine data for a wider result.
Any tips? my current query that only returns one row basicly at a time:
SELECT
“count”,
“item”,
“time”
FROM
“stock”
WHERE
“time” >= $__timeFrom
AND “time” <= $__timeTo

In Grafana, does using this Transformation help at all?

Several SQL examples here Grafana

1 Like