PostgreSQL
 sql >> Database >  >> RDS >> PostgreSQL

creando una lista pseudo collegata in sql

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