Timeseries using MariaDB

Hi Community

Need your help.

I have successfully connected MariaDB to grafana using the mysql plugin and able to chart the timeseries using below query

SELECT
__timeGroupAlias(datetime,__interval,0),
count(items) AS “No of Items sold”
FROM itemsales
GROUP BY 1
ORDER BY __timeGroup(datetime,__interval,0

Its properly showing the timeseries with the count of items sold over time. I am trying to find the item names sold when i point the cursor on map along with count. I have tried adding the items column, but its listing all items and not just the items at that point of time. Below query is not giving what i am looking for. Please suggest

SELECT
__timeGroupAlias(datetime,__interval,0),
count(items) AS “items”,
items AS “items”
FROM itemsales
GROUP BY 1
ORDER BY __timeGroup(datetime,__interval,0)

Thanks in advance,

Do you mean that you want to group by item? You are currently only grouping by time.

Linking in the duplicate question here: Grafana timeseries using mysql data