Hello,
Lets say I have a table that looks like this:
ID | DisplayOrder | UserName
---------------------------
1 | 3 | Bob
2 | 1 | Tom
3 | 6 | Claire
4 | 5 | Sally
5 | 2 | John
6 | 4 | Tim
And I query the table and order by DisplayOrder.
I need an update that will move the display order up or down so, for example, if I want to move sally (currently in position 5) up to 4, I also need to move Tim (currently in 4) down to 5.
And obviously similar logic for moving records down.
Any idea how ot write an update for this?
Thanks.
Lets say I have a table that looks like this:
ID | DisplayOrder | UserName
---------------------------
1 | 3 | Bob
2 | 1 | Tom
3 | 6 | Claire
4 | 5 | Sally
5 | 2 | John
6 | 4 | Tim
And I query the table and order by DisplayOrder.
I need an update that will move the display order up or down so, for example, if I want to move sally (currently in position 5) up to 4, I also need to move Tim (currently in 4) down to 5.
And obviously similar logic for moving records down.
Any idea how ot write an update for this?
Thanks.