MySQL Forums
Forum List  »  German

Messwert aus String extrahieren
Posted by: Thoralf Brandt
Date: June 03, 2021 04:22AM

Hallo, ich bin neu im Forum und habe eine Frage. Ich frage die MySQL Datenbank so ab:
SELECT DISTINCT concat (value) FROM mqtt
WHERE topic LIKE 'Sens/005/pulse/SENSOR' AND date(ts)=curdate()
ORDER BY ts DESC

Ergibt:
{"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“}

Ist es in MySQL möglich nur den letzten Wert 26.7 als Temperatur auszugeben (für Grafana)?

Vielen Dank für die Hilfe

Options: ReplyQuote


Subject
Views
Written By
Posted
Messwert aus String extrahieren
738
June 03, 2021 04:22AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.