Hi, can someone help me doing the following task:
Delete all rows with an timestamp older than 30 days at every device except the following:
'mqtt_klima_1.OG_Bad', 'mqtt_klima_1.OG_Schlaf', 'mqtt_klima_Aussen', 'mqtt_klima_DG_Dachboden', 'mqtt_klima_DG_Schornstein', 'mqtt_klima_EG_Garage', 'mqtt_klima_KG_Getraenke', 'mqtt_klima_KG_Werkstatt'
I tried this, but it wont work:
DELETE FROM history WHERE DEVICE NOT IN (
'mqtt_klima_1.OG_Bad',
'mqtt_klima_1.OG_Schlaf',
'mqtt_klima_Aussen',
'mqtt_klima_DG_Dachboden',
'mqtt_klima_DG_Schornstein',
'mqtt_klima_EG_Garage',
'mqtt_klima_KG_Getraenke',
'mqtt_klima_KG_Werkstatt')
AND
where timestamp < DATEADD(MONTH, -1, GETDATE())