In Oracle, posso selezionare la parte superiore 1 messaggio in una tabella ordinata conSelezionare top N con "per l'aggiornamento Skip bloccato" in Oracle
select messageid from(
select
messageid,
RANK() over (order by messageid asc) as msg_rank
from messages
) where msg_rank=1;
E come ho scoperto in un previous question posso selezionare una riga in esclusiva con
select * from messages where rownum < 2 for update skip locked;
Tuttavia non posso unire questi due concetti insieme
select messageid from(
select
messageid,
RANK() over (order by messageid asc) as msg_rank
from messages
) where msg_rank=1 for update skip locked;
-- results in error
-- ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.
Come posso selezionare esimo e top N con blocco del readpast?
penso che questo post del blog ha alcuni pensieri importanti: http://markjbobak.wordpress.com/2010/04/06/unintended-consequences/ –