Quick

SQL LIKE Pattern Tester

Test a LIKE pattern — % matches any run of characters, _ matches exactly one.

Advertisement

About this tool

In a LIKE pattern, % matches any run of characters (including none) and _ matches exactly one, so A%_e means "starts with A, ends with e, with at least one character in between". Everything else is matched literally, and the whole value has to match, not just part of it. To match a real % or _, put a backslash in front: 50\% or %\_id. That's the default escape character in MySQL and PostgreSQL; in other databases add ESCAPE '\' after the pattern.

Matching ignores case by default, as it does with MySQL and SQL Server's usual collations. Turn on Case-sensitive to see how PostgreSQL's LIKE (or SQLite with non-ASCII text) behaves. SQL Server [ ] sets adds T-SQL's character sets: [abc], [a-f] and [^0-9].