Bert Nelsen wrote:
> I have the problem that one index is not taken into account when I execute a
> query:
> 
> Second column index:
> name: idx_mycolumn2
> collation: -
> unique: false
> ------
> 
> Results for "SELECT * FROM mytable WHERE mycolumn2 LIKE 'a%'"
> 0
> TABLE mytable

LIKE is case-insensitive, and so it can't use a case-sensitive index. For more 
details, see

http://www.sqlite.org/optoverview.html

section 4 "The LIKE optimization"

To find all strings beginning with 'a', consider using something like this:

SELECT * FROM mytable WHERE mycolumn2 >= 'a' and mycolumn2 < 'b';

Igor Tandetnik

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

Reply via email to