On 7/5/2013 10:59 AM, Paul Sanderson wrote:
Sorry - thats what I mean - the table (as redefined by simon)

create table lookup (rowindex int, rangestart int, rangeend int)

values in rowindex are not unique so I cannot make this column a primary
key so i am not sure whether RTrees would be any help in this scenario

create virtual table lookup_tree using rtree_i32(rangeid, rangestart, rangeend);
create table lookup(rangeid integer primary key, rowindex int);

select * from
  master m join lookup l on (m.rowindex = l.rowindex)
  join lookup_tree lt on (l.rangeid=lt.rangeid)
where :x >= rangestart and and :x < rangeend;

--
Igor Tandetnik

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

Reply via email to