Pattern Matching in SQL
LIKE Pattern Operators
% Wildcard
Matches zero or more characters. 'Smith%' finds Smith, Smithson, Smithers.
_ Wildcard
Matches exactly one character. 'J_n' finds Jan, Jen, Jon.
ESCAPE Clause
Use ESCAPE '\' to match literal % or _ in the data.
ILIKE (Postgres)
Case-insensitive variant — doesn't exist in MySQL or SQL Server.
Master SQL at Noble Desktop
Noble Desktop's SQL Bootcamp covers queries, joins, aggregations, and the full SQL toolkit data analysts use every day.
This lesson is a preview from our SQL Course Online (includes software) and SQL Certification Online (includes software & exam). Enroll in a course for detailed lessons, live instructor support, and project-based training.
Next topic. When we're doing these filters, sometimes we're looking for exact matches.