Re:User-defined Order in SQL
by grzm on Wednesday March 21, 2018 @04:35AM
(#16636409)
What would the timestamp represent? Are you providing a timestamp which encodes the position somehow, or using CURRENT_TIMESTAMP? Updating the timestamp for all of the rows in the (sub) list? How does this permit you to reorder the items in the list?
[ Parent
| on HN ]
I haven't implemented this, just brainstorming.
Timestamp would only represent position and enables to put something in between, rather than an integer which adds +1. If put A (timestamp = 100) between B (timestamp = 200) and C (timestamp = 300), just set that order value to middle (150). Naive
It actually looks the same as "What about leaving room?" and, yeah, introduces complexity when you organize items for too long.