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 table t1(
id bigint primary key,
uid bigint,
value bigint,
ts bigint
);
insert into t1 values(1, 1, null, 1),(2, 1, 2, 2),(3, 1, 3, 3);
flush;
select
uid,
last_value(case when ts=2 then value else null end order by ts) as lv
from t1
group by uid;
uid | lv
-----+----
1 | 2
(1 row)
create materialized view mv1 as
select
uid,
last_value(case when ts=2 then value else null end order by ts) as lv
from t1
group by uid;
select * from mv1;
uid | lv
-----+----
1 |
(1 row)
The text was updated successfully, but these errors were encountered:
st1page
changed the title
different result from mv and ad hoc query, may related to last_valuelast_value different result from mv and ad hoc query
Oct 16, 2024
The text was updated successfully, but these errors were encountered: