[EMAIL PROTECTED] wrote:
I get the index for LIKE working by specifying COLLATE in the CREATE
TABLE: CREATE TABLE test (name STRING COLLATE NOCASE), but...

Besides, your statement uses OR in the WHERE clause. An index can't
be used for such query even if you had plain old equality test in
place of LIKE.

You're right, the index isn't working with OR. I thought I can create
two separate indexes: on name and on email, and when I execute a
query with "name LIKE 'value' OR email LIKE 'value'" both indexes
would be used. But that's not happening.

Try

select * from test where rowid in
(select rowid from test where name like 'value'
union all
select rowid from test where email like 'value');

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to