2011/10/19 Fabian <fabianpi...@gmail.com> > > > Maybe there is just no easy way to do what I want, I will take a good night > sleep about it ;) > > I think the correct query would be:
SELECT table1.data1, table2.data2 FROM ( SELECT table1.rowid, table1.data1 WHERE table1.data1 = 10 ) AS table1 JOIN table2 ON table1.rowid = table2.rowid ORDER BY table2.data2 DESC OFFSET 0 LIMIT 250 Which should make sure that only the rows matching WHERE are going to be sorted (instead of all rows). Since I moved the TEXT columns out of my main table to a FTS table, I have all these complex and inefficient joins, because all data is divided between two tables with identical rowids. I hope some day FTS supports INTEGER columns, so I can merge the two back together, and get rid of the joins :) _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users