我是论坛的新手,有一个问题。我这样查询 MySQL 数据库: SELECT DISTINCT concat (value) FROM mqtt WHERE topic LIKE 'Sens/005/pulse/SENSOR' AND date(ts)=curdate() ORDER BY ts DESC
结果:
{"Time":"2021-06-02T13:15:10","AM2301":{"Temperature":26.7,"Humidity":40.6,"DewPoint":12.2},"ESP32":{"Temperature":55.6},"TempUnit":"C"}
{"Time":"2021-06-02T13:10:10","AM2301":{"Temperature":26.7,"Humidity":40.8,"DewPoint":12.3},"ESP32":{"Temperature":55.0},"TempUnit":"C"}
{"Time":"2021-06-02T13:05:10","AM2301":{"Temperature":26.6,"Humidity":41.0,"DewPoint":12.2},"ESP32":{"Temperature":55.6},"TempUnit":"C"}
{"Time":"2021-06-02T13:00:10","AM2301":{"Temperature":26.6,"Humidity":41.3,"DewPoint":12.4},"ESP32":{"Temperature":55.0},"TempUnit":"C"}
{"Time":"2021-06-02T12:55:10","AM2301":{"Temperature":26.6,"Humidity":41.5,"DewPoint":12.4},"ESP32":{"Temperature":55.0},"TempUnit":"C"}
{"Time":"2021-06-02T12:50:10","AM2301":{"Temperature":26.7,"Humidity":41.8,"DewPoint":12.6},"ESP32":{"Temperature":55.0},"TempUnit":"C"}
在 MySQL 中是否可以仅输出最后一个值 26.7 作为温度(对于 Grafana)?例如。JSON_EXTRACT ?
谢谢您的帮助