SQLite Forum

[SELECT] Simple way to search for data that start with given pattern?
Login
Presumably if one were to create an index on the expression SUBSTR(zip,1,2) then the planner would put the temporary table for the IN list in the outer loop and descend into MyTable using that index.

LIKE would, of course, only use a case-insensitive index on zip unless it were told that like were case_sensitive -- the fact that zip contains numbers only is quite irrelevant to whether a text field is case sensitive or not.