Search code examples
sqliteandroid-sqlite

What's the difference between LIKE and GLOB in SQLite?


What the difference in the following to query ?

FROM COMPANY WHERE ADDRESS  GLOB '*-*';
FROM COMPANY WHERE ADDRESS  LIKE '%-%';

I know unlike LIKE operator, GLOB is case sensitive. Is it the only difference ?


Solution

  • The documentation says:

    The GLOB operator is similar to LIKE but uses the Unix file globbing syntax for its wildcards. Also, GLOB is case sensitive, unlike LIKE.

    And that's it.