You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> CREATE DATABASE mydb
> USE mydb
Using database mydb
> INSERT pond toads=2
> INSERT pond toads=4
> INSERT pond toads=9
> SELECT * FROM "pond"
name: pond
time toads
---- -----
2017-02-22T17:44:35.234902449Z 2
2017-02-22T17:44:43.444176616Z 4
2017-02-22T17:44:49.651820179Z 9
Run a subquery that includes just a function in the main query
> SELECT MEAN("toads") FROM (SELECT "toads" FROM "pond")
name: pond
time mean
---- ----
1970-01-01T00:00:00Z 5
(This is fine)
Run a subquery that includes just a WHERE clause in the main query
> SELECT "toads" FROM (SELECT "toads" FROM "pond") WHERE "toads" > 3
name: pond
time toads
---- -----
2017-02-22T17:44:43.444176616Z 4
2017-02-22T17:44:49.651820179Z 9
(This is also fine)
Run a subquery that includes both a function and a WHERE clause in the main query
> SELECT MEAN("toads") FROM (SELECT "toads" FROM "pond") WHERE "toads" > 3
>
(Unexpectedly - no results)
Expected behavior:
I'd expect the query in step 4 to return the average value of toads calculated across values of toad that are greater than three:
name: pond
time mean
---- ----
1970-01-01T00:00:00Z 6.5
Actual behavior:
The query in step 4 returns no results.
Additional information:
Queries with a subquery, a function in the main query, and a WHERE time clause in the main query behave as expected:
> SELECT MEAN("toads") FROM (SELECT "toads" FROM "pond") WHERE time >= '2017-02-22T17:44:43.444176616Z' AND time <= '2017-02-22T17:44:49.651820179Z'
name: pond
time mean
---- ----
2017-02-22T17:44:43.444176616Z 6.5
The text was updated successfully, but these errors were encountered:
rkuchan
changed the title
[1.2.1~rc4] Subqueries; A function and WHERE clause in the main query returns no results
[1.2.1~rc4] Subqueries; A function and WHERE tag clause in the main query returns no results
Feb 22, 2017
Bug report
System info:
Ubuntu 16.04, v1.2.1~rc4
Steps to reproduce:
(This is fine)
(This is also fine)
(Unexpectedly - no results)
Expected behavior:
I'd expect the query in step 4 to return the average value of
toads
calculated across values oftoad
that are greater than three:Actual behavior:
The query in step 4 returns no results.
Additional information:
Queries with a subquery, a function in the main query, and a
WHERE
time clause in the main query behave as expected:Taken from a Google Groups post: https://groups.google.com/forum/#!topic/influxdb/MOSSMVdFz2g
The text was updated successfully, but these errors were encountered: