I have a table with a custom sort order column.
ID NAME ORDER
1 Jack 4
2 Jill 2
3 Mike 5
4 Mark 1
5 Bill 3
I would like to insert a new record with an ID of 6, a NAME of Jane, and an ORDER of 3. I would like to insert it such that the old records are incremented to make room for the new record, resulting in something like this:
ID NAME ORDER
1 Jack 5
2 Jill 2
3 Mike 6
4 Mark 1
5 Bill 4
6 Jane 3
Can this be done using a SQL script? I was looking at this answer, but I'm not sure it can be made to work in my case. Plus it requires an extra table to temporarily hold values, which I would like to avoid.
Thanks.
[edit]
I forgot to add that there is a unique constraint non the third column. Though I understand there are ways of getting around this.