Open kazzacarrot opened 8 years ago
I think this is the desired query:
Update table set image = null
HAVING lightluxlevel <> max(lightLuxLevel)
GROUP BY time::date
I'm just not sure.
To delete all images: update table set image = null
ie. update urbanfarming.processeddata set image = null
To delete all images where light lux level < 10000: update table set image = null where lightluxlevel < 1000
ie. update urbanfarming.livedateyo set image = null where lightluxlevel < 1000
Make a node job that will trigger at 1amGMT and will delete images. Leaving only one per device per day where the light level was at a peak.