title: Selecting multiple values/aggregators from Influxdb, excluding time
body: <p>I got a influx db table consisting of </p>
  
  <pre><code>&gt; SELECT * FROM results
  name: results
  time                artnum   duration 
  ----                ------   --------   
  1539084104865933709 1234     34  
  1539084151822395648 1234     81  
  1539084449707598963 2345     56  
  1539084449707598123 2345     52
  </code></pre>
  
  <p>and other tags. Both <code>artnum</code> and <code>duration</code> are fields (that is changeable though). I'm now trying to create a query (to use in grafana) that gives me the following result with a calculated <code>mean()</code> and the number of measurements for that <code>artnum</code>:</p>
  
  <pre><code>artnum   mean_duration  no. measurements
  ------   --------       -----  
  1234     58             2
  2345     54             2
  </code></pre>
  
  <p>First of all: Is it possible to exclude the <code>time</code> column? Secondly, what is the influx db way to create such a table? I started with</p>
  
  <pre><code>SELECT mean("duration"), "artnum" FROM "results"
  </code></pre>
  
  <p>resulting in <code>ERR: mixing aggregate and non-aggregate queries is not supported</code>. Then I found <a href="https://docs.influxdata.com/influxdb/v1.6/guides/downsampling_and_retention/" rel="nofollow noreferrer">https://docs.influxdata.com/influxdb/v1.6/guides/downsampling_and_retention/</a>, which looked like what I wanted to do. I then created a infinite retention policy (duration 0s) and a continuous query</p>
  
  <pre><code>&gt; CREATE CONTINUOUS QUERY "cq" ON "test" BEGIN 
  SELECT mean("duration"),"artnum"
  INTO infinite.mean_duration 
  FROM infinite.test 
  GROUP BY time(1m) 
  END
  </code></pre>
  
  <p>I followed the instructions, but after I fed some data to the db and waited for 1m, `SELECT * FROM "infinite"."mean_duration" did not return anything.</p>
  
  <p>Is that approach the right one or should I continue somewhere else? The very goal is to see the updated table in grafana, refreshing once a minute.</p>