Indexes in SQLite
Posted: Sun Nov 30, 2014 10:15 pm
Hi
I have tried to create a reverse key for my main key in a simple database so that I can read the key in reverse order (to do a read previous on the table).
I use a query like select * from xyz table indexed by revindex. Revindex contains the key from the xyz table but in descending order.
The query says there is no solution for the query unless I use the key in the following query:
select mainkey from xyz table indexed by revindex. In this case the data is displayed but it appears in mainkey order not reverse main key order of the revindex.
1
2
3
4
5
Is what appears in the output to the query instead of 5 4 3 2 1.
Is there any way to get sqlite to do this the way i want it to work so I can read previous?
John O'Rourke
I have tried to create a reverse key for my main key in a simple database so that I can read the key in reverse order (to do a read previous on the table).
I use a query like select * from xyz table indexed by revindex. Revindex contains the key from the xyz table but in descending order.
The query says there is no solution for the query unless I use the key in the following query:
select mainkey from xyz table indexed by revindex. In this case the data is displayed but it appears in mainkey order not reverse main key order of the revindex.
1
2
3
4
5
Is what appears in the output to the query instead of 5 4 3 2 1.
Is there any way to get sqlite to do this the way i want it to work so I can read previous?
John O'Rourke