sql >> Base de Datos >  >> RDS >> PostgreSQL

¿Cómo hago que el resultado de las consultas SQL con LIMIT sea diferente en cada consulta?

¿Has intentado actualizar/devolver?

update link
set visiting = true
from (
    select id
    from link
    where visiting = false
    and visited = false
    limit 500
    for update
    ) as batch
where batch.id = link.id
returning *;