Re: [sqlite] Scrolling thru an index

2006-03-24 Thread Dennis Cote
JP wrote: Jay Sprenkle wrote: My application is geared towards users who want to find a specific name in a list of names, and then want to have the possibility to scroll backwards or forwards. For example, if I search for Sprenkle I want to show the user a window with Sprenkle in the

Re: [sqlite] Scrolling thru an index

2006-03-24 Thread Jay Sprenkle
In SQLite these can be combined into one query that gets the desired rows. select * from mytable where Name = ( select Name from mytable where Name 'Sprenkle' order by Name desc limit 1 offset 50) order by Name limit 101; This query works as expected in SQLite so it should

Re: [sqlite] Scrolling thru an index

2006-03-24 Thread JP
In SQLite these can be combined into one query that gets the desired rows. select * from mytable where Name = ( select Name from mytable where Name 'Sprenkle' order by Name desc limit 1 offset 50)order by Name limit 101; This query works as expected in SQLite so it should be a

Re: [sqlite] Scrolling thru an index

2006-03-23 Thread JP
Jay Sprenkle wrote: My application is geared towards users who want to find a specific name in a list of names, and then want to have the possibility to scroll backwards or forwards. For example, if I search for Sprenkle I want to show the user a window with Sprenkle in the middle, preceded by

Re: [sqlite] Scrolling thru an index

2006-03-22 Thread Jay Sprenkle
Is there a way I can scroll thru a particular index? For example: 1. Scroll forward/backward on a given set of records 2. Start at position X 3. Start at a record that matches a criteria SQL is optimized to manipulate a set of records. It's much faster to execute update mytable set mycolumn

Re: [sqlite] Scrolling thru an index

2006-03-22 Thread JP
Jay Sprenkle wrote: Is there a way I can scroll thru a particular index? For example: 1. Scroll forward/backward on a given set of records 2. Start at position X 3. Start at a record that matches a criteria SQL is optimized to manipulate a set of records. It's much faster to execute update

Re: [sqlite] Scrolling thru an index

2006-03-22 Thread Ulrik Petersen
Hi JP, JP wrote: Anyway, maybe separate topic, I tried to create a snapshot window of the above using plain SQL, but it doesn't seem to work on Sqlite 3.3.4: CREATE TABLE clients (custid integer primary key, lastname varchar(50)); CREATE INDEX cidx ON (lastname); (insert 10,000 records

Re: [sqlite] Scrolling thru an index

2006-03-22 Thread JP
Ulrik Petersen wrote: Hi JP, JP wrote: Anyway, maybe separate topic, I tried to create a snapshot window of the above using plain SQL, but it doesn't seem to work on Sqlite 3.3.4: CREATE TABLE clients (custid integer primary key, lastname varchar(50)); CREATE INDEX cidx ON (lastname);

Re: [sqlite] Scrolling thru an index

2006-03-22 Thread John Stanton
JP wrote: Jay Sprenkle wrote: Is there a way I can scroll thru a particular index? For example: 1. Scroll forward/backward on a given set of records 2. Start at position X 3. Start at a record that matches a criteria SQL is optimized to manipulate a set of records. It's much faster to

Re: [sqlite] Scrolling thru an index

2006-03-22 Thread Jay Sprenkle
My application is geared towards users who want to find a specific name in a list of names, and then want to have the possibility to scroll backwards or forwards. For example, if I search for Sprenkle I want to show the user a window with Sprenkle in the middle, preceded by the 50 names

[sqlite] Scrolling thru an index

2006-03-21 Thread JP
In a previous message: The way indices work in SQLite is that there is one row in the index for each row in the table but the index rows are in index order. ... D. Richard Hipp [EMAIL PROTECTED] Is there a way I can scroll thru a particular index? For example: 1. Scroll