you will need an inner select that selects everything and orders that, then an 
outside select that pages from the inner select.


Woody
Wizard, at large
"I'm in shape, round is a shape!"



 

--- On Tue, 10/18/11, Fabian <fabianpi...@gmail.com> wrote:


From: Fabian <fabianpi...@gmail.com>
Subject: Re: [sqlite] Fast JOIN
To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
Date: Tuesday, October 18, 2011, 10:17 PM


>
>
> Assuming that is a typo, does the following not do what you want?
>
> SELECT table1.data1, table2.data2
> FROM
> (
> SELECT table1.rowid, table1.data1
> WHERE table1.data1 = 10
> ORDER BY table1.rowid DESC
> OFFSET 0 LIMIT 250
> ) AS table1
> JOIN table2
> ON table1.rowid = table2.rowid
> ORDER BY table2.rowid;
>
>
No, because it only sorts the current page. When the user scrolls down using
the scrollbar, and the second page is fetched (OFFSET 250 LIMIT 250), it
does not match up with the sorting of the previous page. Suppose it was
sorted by a TEXT column of table2, it would look like this:

Page 1:

aaa
abb
ddd

Page 2:

bba
cca
dda

Maybe there is just no easy way to do what I want, I will take a good night
sleep about it ;)
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to