Re: [sqlite] How to use "IN" keyword for multi-column index

2008-05-22 Thread Alexander Batyrshin
> 2. I tried this first: [ select * from map where (x=1 and y=1) or (x=1 and > y=2) or (x=1 and y=3) ] but that didn't use the index -- not on 3.5.6 anyway AFAIK "OR" will always omit indexes, this is why I am trying to use "IN" -- Alexander Batyrshin aka bash bash = Biomechanica Artificial Sab

Re: [sqlite] How to use "IN" keyword for multi-column index

2008-05-22 Thread Stephen Oberholtzer
On Thu, May 22, 2008 at 2:02 PM, Igor Tandetnik <[EMAIL PROTECTED]> wrote: > IN only works on a single column. The closest you can get to this is > something like > > SELECT map.* > FROM map join ( > select 1 x, 1 y > union all > select 1 x, 2 y > union all > select 1 x, 3 y)

Re: [sqlite] How to use "IN" keyword for multi-column index

2008-05-22 Thread Alexander Batyrshin
> IN only works on a single column. The closest you can get to this is > something like > > SELECT map.* > FROM map join ( > select 1 x, 1 y > union all > select 1 x, 2 y > union all > select 1 x, 3 y) t > ON map.x = t.x AND map.y=t.y; Thanks. I will use more than 3 keys, so I

Re: [sqlite] How to use "IN" keyword for multi-column index

2008-05-22 Thread Stephen Oberholtzer
On Thu, May 22, 2008 at 1:41 PM, Alexander Batyrshin <[EMAIL PROTECTED]> wrote: > Hello All, > For example we have table like this: > > CREATE TABLE map ( > name text, > x integer, > y integer > ); > CREATE INDEX map_xy ON map(x,y); > > How to query this table with "IN" keyword? > Query like t

Re: [sqlite] How to use "IN" keyword for multi-column index

2008-05-22 Thread Igor Tandetnik
Alexander Batyrshin <[EMAIL PROTECTED]> wrote: > Hello All, > For example we have table like this: > > CREATE TABLE map ( > name text, > x integer, > y integer > ); > CREATE INDEX map_xy ON map(x,y); > > How to query this table with "IN" keyword? > Query like this, doesn't work: > > SELECT * FRO