PostgreSQL
 sql >> Datenbank >  >> RDS >> PostgreSQL

Erstellen einer pseudoverknüpften Liste in SQL

select 
  id, 
  location, 
  order_id,
  lag(id) over (order by order_id desc) as next_id
from your_table