I need to query a SQLite database for items that either match a given string, or are LIKE query%. However, it’s not as simple as
SELECT id, type, number FROM roads WHERE number = '12' OR number LIKE '12%'
I need all equal matches to come before the LIKE matches. I picture there being an AS in there somewhere and ordering by it, but I’m not sure how it would work. I want to avoid making two queries if possible.
I’m not sure if this syntax is supported on Sqlite, but here’s an idea: