Influx DB delete some measurments

i know not a Node Red Problem. but the better Forum to get help!
i still use Influx DB 1.8x

a Sensor send wrong data Temperatur over 7000 Degree.
i would like to delete them i find the wrong entry and delete them with the correct timestamp.
but can't find out how to say

DELETE FROM GOE_RAW WHERE temperature > 60
ERR: shard 6: fields not supported in WHERE clause during deletion

have a nice day

Assuming that a SELECT WHERE with that condition works, then do that and then run through then and delete using the time in the WHERE clause.
It may be possible to do the same with a clever nested query, but if it is a one off issue then I would do it the simple way.
Make sure your database backup is up to date first, of course, and inspect the results from the first query before passing it on to the second.

Apart from @Colin's suggestion you could copy everything into a new measurement and filter
out the records you don't need. Then delete the contents of the first measurement and copy back:

SELECT * INTO <destination_measurement> FROM <source_measurement> [WHERE <criteria>] GROUP BY *

@ghayne I believe that would create a new set of time stamps messing up any graphing by time.

You might be right Paul, but easy to check.

[EDIT] Timestamps are preserved using the above method!

1 Like

Is the GROUP BY clause necessary there ?

I think it is Colin, I seem to remember it stops tags being converted to fields in the target table. I haven't got a table with tags to try it.

@Colin, from the documentation:

The GROUP BY * clause preserves tags in the source database
 as tags in the destination database.

Good catch.