Hi!
I found another bug:
Preparing data:
Code:
drop table if exists test_avg;
create table test_avg (
datetime timestamp not null
) with structure = vectorwise;
insert into test_avg values ('2012-07-01 00:00:01');
insert into test_avg values ('2012-07-01 00:00:02');
insert into test_avg values ('2012-07-02 00:00:03');
insert into test_avg values ('2012-07-02 00:00:04');
\g
Subquery code:
Code:
select cast(datetime, ansidate) x
from test_avg
group by cast(datetime, ansidate)
Outputs:
|x |
+----------+
|2012-07-01|
|2012-07-02|
What is correct
But:
Code:
select count(x) daily_avg_log
from (
select cast(datetime, ansidate) x
from test_avg
group by cast(datetime, ansidate)
) a;
\g
Outputs 4.