Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Add column update_at_utc of type datetime2.
- 2. When inserting, update_at_utc = GETDATEUTC()
- 3. When retrieving, order by update_at_utc
- 4. When moving a row in the queue, for example between rows 3 and 4, simply take average of update_at_utc of these rows and use it to set update_at_utc of the row being moved.
- 1. Remember update_at_utc of the row N places lower down
- 2. For all rows between the current and the new position: assign row's update_at_utc to the preceding row's update_at_utc
- 3. Assign update_at_utc of the row being moved to the date remembered in point 1 above.
Add Comment
Please, Sign In to add comment