DISTINCT(field) returns only one result

Simple. We need to get all UNIQUE fields.

  1. SELECT DISTINCT(user_string) FROM influxdb.autogen.logs.
  • It fails - does not get anything
  1. SELECT DISTINCT(user_string) FROM (SELECT * FROM influxdb.autogen.logs)
  • It delivers ONE value, but
  1. SELECT COUNT(DISTINCT(user_string)) FROM (SELECT * FROM influxdb.autogen.logs)
  • It delivers 1243 number of distinct users
    –> How can i enable DISTINCT to return all distinct values?

Fixed it:
SELECT DISTINCT(user_string) FROM (SELECT * FROM influxdb.autogen.logs GROUP BY user_string) GROUP BY host_string

1 Like