Hello everyone,
First of all I’m sorry if this question has been already asked, I couldn’t find any consistent answer. I’m new to influxDB, so I’m probably not doing the right thing, please bear with me.
Ok, I have a measurement that looks like the one below, and I would like to display only one occurrence based on the “USR” column (FYI, “Date” is set as the only tag)
time USR ID State Date
---- ---- -- ------ ----
1543575665033956033 User1 117 1 2018-11-27 17:29:22
1543575672012725616 User1 117 0 2018-11-27 17:29:22
1543575678687792480 User2 114 0 2018-11-27 17:46:04
1543575678687792481 User2 114 0 2018-11-27 17:46:04
1543575681949425390 User3 115 0 2018-11-27 17:46:06
1543575681949425391 User3 115 0 2018-11-27 17:46:08
1543575763613598755 User4 112 0 2018-11-27 17:46:16
I would like to run a query to get and display this result when the field State = 0 :
time USR ID State Date
---- ---- – ------ ----
1543575678687792481 User2 114 0 2018-11-27 17:46:04
1543575681949425391 User3 115 0 2018-11-27 17:46:06
1543575763613598755 User4 112 0 2018-11-27 17:46:16
I’ve tried many thing with distinct(), it works but doesn’t show all the remaining fields, how can I do to get the display I’m looking for ?
Many thanks in advance