Lets consider I have a table:
CREATE TABLE student (
id int,
name varchar(128)
);
INSERT INTO student (id,name) VALUES
(1,'John'),
(2,'Bob'),
(3,'Alice'),
(4,'Don'),
(5,'Eve');
I need the 'names' column to exchange places with next one: 1 with 2, 3 with 4 and etc, but keep the order of 'id'. The selected output should be something like this:
id names
1 | Bob
2 | John
3 | Don
4 | Alice
5 | Eve
Is there an effective way to write query that would give me expected result?
CreatedDate
, orLastName
, etc) or it's random?