In the table I want to be able to 'move' rows. I have a column called sortid
, which automatically on insert is one value higher than the highest value (easily found by selecting top value when sorting my sortid desc).
But I'm a bit confused on what query I'd use for the the 'up/down' actions for each row on my ASP.NET page. What query would I use to select the rows immediately 'below' or 'above' the row to be moved?