News for hackers. Stuff that matters.
Re:User-defined Order in SQL by speleding on Wednesday March 21, 2018 @06:47AM (#16636899)
I agree, but I use a small improvement to the first approach: split each insert into two steps: "insert at end" and "reorder". That way: (a) the insert is nice and simple and (b) you can reuse the code for re-order which you likely need anyway (and which solves the foreign key constraint issue, perhaps by doing it in a single SQL update).
Re:User-defined Order in SQL by mason55 on Wednesday March 21, 2018 @09:55AM (#16637973)
That was my first thought. Disallow inserting into the middle of the list and solution 1 becomes much simpler.