PostgreSQL Function Reference

LAG
Provides access to a row at a specified offset prior to the current row.
PostgreSQL 17.5
LAG(column [, offset ] [, default])
column
The column
offset
The offset
default
Default value
Examples
PostgreSQL 17.5
SELECT LAG(member_name) OVER(
		ORDER BY birthday
	)
FROM FamilyMembers;