A
A
AndroidDev20152016-03-18 16:30:12
Android
AndroidDev2015, 2016-03-18 16:30:12

How to order integer field with unique property in sqlite?

There is a table

create table delivery (_id integer primary key autoincrement, 
                                    datemillis integer not null, 
                                    address_position integer not null unique);

It is necessary to order the address_position field without changing the order, how can this be done using the sql language? or how to do it with minimal write operations in android?
We have values ​​-> To become
1 -> 1
2 -> 2
4 -> 3
7 -> 4
8 -> 5
9 -> 6
15 -> 7
21 -> 8
22 -> 9
29 -> 10

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2016-03-18
@itvdonsk

Make in a transaction

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question