Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Swap row sequence numbers?
Our web application displays rows from a table in a HTML table, ordered by a sequence number.
I would like to add a feature that would allow a user to move a row up or down relative to its neighbors, perhaps by clicking an up and down arrow (as opposed to forcing them to type a new sequence number).
Is there a SQL-92 statement, that will swap a row's sequence number with another's when all it knows is the row being clicked and the direction of movement? Something like:
UPDATE my_table
SET sequence = (hard part here)
WHERE row_key_1 = something
AND row_key_2 = somethingelse
Thanks,
Craig Buchanan
![]() |
![]() |