SELECT 

LEAD(id) OVER () AS prev, -- offset rows after the current row within the partition

LAG(id) OVER AS next -- offset rows before the current row within the partition


AND