yarek
yarek

Reputation: 12064

MS access : how to add 1 row between 2 rows?

I have an access database with these tables: - sequences: it describes the sequences of a movie : ex: boy kicking ball (1) , boy hitting ball(2), boy speaking(3) etc..

My problem is : how can I insert a new sequence because access always inserts it to the end. ex: I would like to get (I would like to insert sequence 3 between 2 and 1) 3 - 2 - 3 - 1 - 2

and Access will give me 3 - 2 - 1 - 2 - 3 (added to end)

Any clue ?

Upvotes: 2

Views: 4918

Answers (1)

Harald Brinkhof
Harald Brinkhof

Reputation: 4455

The order of inserting data in a database is inconsequential, what is important is the order of retrieval which you manipulate by the ORDER BY substatement you provide your SELECT statement with.

So you'll need to identify the field by which you can order things, e.g. a sequence id and then order on that field. like thus

SELECT * FROM movie_sequences ORDER BY movie_sequence_id ASC;

Upvotes: 6

Related Questions