I have seen this guide on how to handle duplicate data points: https://docs.influxdata.com/influxdb/v2.0/write-data/best-practices/duplicate-points/
I would like to use the suggested case with adding a uniq tag. My main question is: Is there a clever way to request just the newest data points (highest uniq tag value). So lets assume I initially store a timeseries with the tag uniq = 1. Later I provide new datapoints which have the same timestamp as existing ones but with a uniq tag of value 2. Now I would like to send a request which delivers uniq = 2 data points if present and otherwise uniq = 1 datapoints. So for example if the inital timeseries contained 10.000 points with uniq = 1 and I later store 1000 new data point with uniq = 2 (with existing time stamps) - I would like to send a request that returns 10.000 data points of which 9.000 are old (uniq = 1) and 1000 are new (uniq = 2). I there a simple way to do that?
Remark: Before you ask why I don’t want to overwrite the datapoints if I only want to the newest ones: While getting the newest ones will be the most used request I have I would like to keep the option to request the original timeseries as well.
If possible I would prefer an answer in InfluxQL since I have no experience with Flux, yet. But if it is much easier to do with flux I may see this as a starting point to get into flux.