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 work around for your union bug.

Very, very nice.  The idea is right on!  I made a tweak:

The query works well, except when searching names within the first 50, i.e. if I search 'AAA', it doesn't bring anything. To fix it, I added a "coalesce(x,'')", where x is the inner select:

select * from mytable where name >=  Coalesce(
        (select name from mytable where name < 'A'
        order by name desc limit 1 offset 50)
        ,'')
order by name limit 101;

This works well on the full range.

Thanks all!

jp

Reply via email to