Hello everybody,
I’m learning influxdb now. If you could help me with below question that would be greatly appreciated.
Influx db: 1.8
measurement: codes
tagKey
status
fieldKey fieldType
M100 string
M200 string
M300 string
M300 string
M400 string
(Note: Number of field keys are in the measurement “codes” could any number.)
data being inserted in “codes” measurement for each field. Data could be inserted into measurement for one or more field keys every 1 Hz. So, there may be multiple records for some field keys and probably one or zero records inserted for other field keys.
I wanted to query last inserted record for each field key with corresponding time stamps (Please refer to expected output above.).
I tried, SELECT DISTINCT(*) FROM “codes” ORDER BY time DESC
based on influxdb 1.8 documentation SELECT DISTINCT(*) FROM “codes” suppose to work. But, query returns error expected field key inside DISTINCT parenthesis.
last(*) won’t work for me because timestamp is condensed to one.
Appreciate your help.
Thanks.
Eddy