Igor Tandetnik wrote:
> "Ian Walters" <[EMAIL PROTECTED]> wrote in
> message news:[EMAIL PROTECTED]
>> What I'm trying to do is create an ordered table in SQLite that I can
>> then look up by row number.  If performance isn't considered this is
>> actually quite easy.  For example
>>
>> CREATE TEMPORARY TABLE mytable AS ... complex select statement ordered
>> by label, recordId ....;
>> CREATE INDEX ON mytable (label, recordId);
>>
>> SELECT recordId, label FROM mytable ORDER BY label, recordId LIMIT 1
>> OFFSET row;
> 
> See if this helps:
> 
> http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor
> 

Thanks for the suggestion.  That indeed works when you know what the
last title was, and I have code that handles that logic for the more
complex select (if you want to see it, it is GPL, release 4.3 of Qtopia,
src/libraries/qtopiapim/qsqlpimtablemodel.cpp).  One of my goals with
the design I'm investigating is to reduce the complexity of the C++ code
while increasing flexibility of the schema.

Perhaps I won't be able to offload quite as much onto SQLite as I hoped.

btw, thanks also to the SQLite coders for creating such a stable, fast,
small, powerful and incredibly good value product.  Very little I've
looked at comes close to SQLite on portable devices.

--
Ian
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to