I have a temperature sensors - each sensor is sending data at different time. I would like to use one query to get all temperatures and plot on one graph with time series.
I would like to have result like
But having like :
Data are store in mysql DB. Query which I’m using looks like
SELECT UNIX_TIMESTAMP(time) AS "time", CONCAT(room, ' ', name) AS metric, state FROM metrics WHERE time BETWEEN FROM_UNIXTIME(1651372668) AND FROM_UNIXTIME(1651394268) AND component_type LIKE "TEMP_SENSOR" ORDER BY time
How can I get result as expected - so present all temperatures on one graph using one mysql query ?