Hi,
I have my recorder setup with MySQL, but i’m a MySQL query noob. Can some MySQL guru’s help me out?
I found this example somewhere on this forum:
- platform: sql
queries:
- name: testSQL
query: "SELECT * FROM states WHERE entity_id = 'sensor.energy_import_total_maandelijks_kwh' ORDER BY ABS(LAST_DAY('2020-12-1')) LIMIT 1;"
column: 'state'
I want to get the state value from the last day of the month, but it has to be the last value of that day. The query from above works, but it shows the first value of that day instead of the last value.
Thanks!!