Tobias Vesterlund <tobias.vesterl...@ericsson.com> wrote: > But If I do SELECT max(id) FROM t WHERE id > 0 LIMIT 10; it will return 99. > > My logic, which may be flawed in this case, tells me the third SELECT should > return 10 and not 99. > > Is it possible to get the highest value in a "limited column" when using > LIMIT?
You seem to want the tenth smallest ID. Try this: select id from t where id > 0 order by id limit 1 offset 9; -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users