SQLite Forum

A suboptimal solution - not using the index.
Login
But you need to remember that cast(1 as integer) == cast("1" as text), so just because one field is alway a string doesn't mean it can't match a numeric value.