Answer the question
In order to leave comments, you need to log in
How to make positions in the database?
I have a plate in which the records should go in order
1 - position 1
2 - position 2
3 - position 3
4 - position 4
5 - position 5
I want, for example, to shift 1 element by 3 positions, it will be after 4 elements, the rest will move 1 forward
I would also like to be able to move the element to the end of the list
. How can this be done?
Answer the question
In order to leave comments, you need to log in
shift 1 element by 3 positions
UPDATE … SET line = line + 3
move element to end of list
UPDATE … SET line = ( SELECT MAX(line) + 1 … )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question