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
I had searched in the issues and found no similar issues.
Version
v1.2.615
What's Wrong?
The cumulative (like for annual) sum function does not return the expected value:
databend: wrong result and not sure what to do with the result.
postgresql: right result we expected.
How to Reproduce?
databend:
droptable test_group;
createtabletest_group (
input_date date,
value decimal(10,2)
);
insert into test_group values ('2024-01-01', 100),('2024-01-01', 200),('2024-01-02', 400),('2024-01-02', 800);
select input_date, sum(value),
(selectsum(value)
from test_group b
whereb.input_date>= DATE_TRUNC(YEAR, input_date)
andb.input_date<=a.input_date) as total
from test_group a
group by input_date;
postgresql:
droptable test_group;
createtabletest_group (
input_date date,
value decimal(10,2)
);
insert into test_group values ('2024-01-01', 100),('2024-01-01', 200),('2024-01-02', 400),('2024-01-02', 800);
select input_date, sum(value),
(selectsum(value)
from test_group b
whereb.input_date>= date_trunc('year', input_date)
andb.input_date<=a.input_date) as total
from test_group a
group by input_date;
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Search before asking
Version
v1.2.615
What's Wrong?
The cumulative (like for annual) sum function does not return the expected value:
databend: wrong result and not sure what to do with the result.
postgresql: right result we expected.
How to Reproduce?
databend:
postgresql:
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: