SQLite Forum

[SELECT] Simple way to search for data that start with given pattern?
Login
Hello,

I need to find all the records where the ZIP code starts with such and such digits.

Apparently, SQLite doesn't support regexes ("Error: no such function: REGEXP"), so that won't do:
SELECT COUNT(*) FROM MyTable WHERE zip REGEXP '^(01|04|54)';
SELECT COUNT(*) FROM MyTable WHERE zip REGEXP '^01|^04|^54');

Is there something easier than a long list of LIKE?
SELECT COUNT(*) FROM MyTable WHERE zip LIKE "01%" OR LIKE "04%" etc.

Thank you.