SQL LIKE Pattern Tester
Check what a LIKE pattern really matches before it goes into a WHERE clause. Pick a database, type the pattern exactly as it appears between the quotes, and every sample line is marked as a match or not, using that database's wildcard, ESCAPE and case-sensitivity rules (including SQL Server [a-z] ranges and MySQL backslash handling). The escape helper turns literal text such as 50% or file_name into a safe LIKE clause. Everything runs in your browser.
SQL: WHERE col LIKE 'report\_%.csv'
Pattern value seen by LIKE: "report\\_%.csv"
Equivalent regex: ^report_[\s\S]*\.csv$
Matches: 1 of 9
PostgreSQL LIKE is always case-sensitive, regardless of collation (nondeterministic collations reject LIKE before Postgres 18).
Escape literal text for LIKE
Do more than sql like pattern tester — meet Chat2DB
Chat2DB is an AI-powered SQL client for Windows, macOS and Linux. Write SQL in natural language, format and optimize queries automatically, and manage MySQL, PostgreSQL, Oracle and 20+ other databases in one workspace.
How to use
- Choose the database and enter the LIKE pattern as written inside the SQL quotes; adjust ESCAPE and case rules if your column collation differs.
- Paste sample values, one per line, and review which rows match and the equivalent regular expression.
- Use the escape helper to search for text containing literal %, _ or [ characters and copy the generated SQL.
Frequently asked questions
How do I match a literal % or _ in SQL LIKE?
Escape it. PostgreSQL and MySQL use backslash by default, so LIKE '50\%' matches the text 50%. SQL Server, SQLite and Oracle have no default escape character: write LIKE '50!%' ESCAPE '!' or, in SQL Server, use brackets such as LIKE '50[%]'.
Is SQL LIKE case-sensitive?
It depends on the database. PostgreSQL LIKE is case-sensitive (use ILIKE for case-insensitive matching). Oracle is case-sensitive by default. MySQL and SQL Server follow the column collation, and their usual defaults are case-insensitive. SQLite ignores case for ASCII letters only.
Can a tool write and test LIKE filters against my real data?
Chat2DB connects to PostgreSQL, MySQL, SQL Server, SQLite, Oracle and more. You can describe the filter in plain English, let its AI write the WHERE clause, and run it against your own tables. Download it from chat2db.ai/download or open the web app.
