hello @Anaisdg
thanks for your feedback, i did not understand your information
but i found to copy the db itself and then deletet the measurment not needed
and renamed with into the measurment.
NOW
i also inject with node red into the DB this works
but in the old db it was below the avarage and new it is added to temp
select * from temperatur ORDER BY time DESC LIMIT 10
name: temperatur
time | average | temp
The task itself can be really easy but I need some additional info.
You see you are running InfluxDB 1.8x, do you want to keep the same version?
Do you want to move the data on a different DB in the same server or on some other server?
Now I’ll assume you are trying to move data locally, so just from a DB on the server to another DB on the same server.
You just need to use the INTO clause, in the docs you will find several useful examples, even to move lots of data.
The query you need is as simple as
SELECT *
INTO "__DestDDB__"."__DestRp__"."__DestMeasurementName__"
FROM "__CurrentDB__"."__RP__"."__Measurement__"
GROUP BY *
Note that the GROUP BY * at the end is extremely important as it will keep tags and fields as they are, without it all the data will be stored as fields.
If you have a lot of data you might want to filter the data and load them a week at a time (or whatever suits you)
In order to make it work, you just need:
create the destination DB
create the desired retention policy
the measurement will be created automatically when the data are written
maybe it helps with the printscreen
the measurment befor was called avarage!
i renamed it into temperature
and with the select * query in the picture i take it from the new masurment temperature
but it still keep somewhere avarag.
the temp is the input in the last houers!
That’s not a measurement name, that’s a field name and is completely different.
you can’t rename fields, the process to “rename” them is to:
Copy the data to a new measurement (a temporary one), using SELECT INTO (you also need to rename the field using an alias)
Drop the original Measurement
Copy the data from temp back to the desired one
remove the temp measurement
which translates to something like this
SELECT average AS temp INTO tmpdata FROM temperature GROUP BY *
SELECT temp INTO tmpdata FROM temperature GROUP BY *
DROP MEASUREMENT temperature
SELECT temp INTO temperature FROM tmpdata GROUP BY *
DROP MEASUREMENT tmpdata
at first it did not work time/written both 0
then i check it i had a spelling error or just german
changed and it worked as you wrote
thank you very much
is this temp a tag?
or would it be better to have taged datas?
in the future i would like to count days above 20 25 or 30 degree and compare it with the past
i also would check at 06:00 if the last past 12h are below 20 degree this would be a tropical night, but this magic would then be in Grafan v8
“temp” was a measurement, you can see it as the equivalent of a table if you are used to SQL databases.
That said, InfluxDB works in a very different way.
I suggest you have a good look at the docs, starting from here, most of the common needs have already been answered here on the forum, so you shouldn’t have problems when it comes to finding answers.
About your need to track days/hours, well it does not come out of the box at least using InfluxQL, you might have some more luck with Flux, but I’m not that knowledgeable in it.
Have a look around about days/hours once you get some solid bases about how the DB structure works and how it can be queried as that is actually the key to your needs