SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table test(id serial, tp int, t text); insert into test (tp, t) values (1, 'some'), (1, 'hello'), (1, null), (1, null); select *, last_value(t) over (partition by tp order by (t is not null) nulls first ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from test order by id;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear