clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 984328 fiddles created (11658 in the last week).

-- -- -- create table sample ( id int primary key, flag tinyint, coluna int ); insert into sample values (1, 0, 20) ,(2, 0, 23) ,(3, 0, 40) ,(4, 1, 45) ,(5, 1, 50); select id, coluna, lag(coluna) over (order by id) as lag_coluna from sample -- -- --
id coluna lag_coluna
1 20
2 23 20
3 40 23
4 45 40
5 50 45
 hidden batch(es)