LIKE
pattern match
What changes
- Input
- string and pattern (wildcards %, _, [], [^], ESCAPE)
- Output or change
- TRUE/FALSE/UNKNOWN
Syntax at a glance
match_expression [ NOT ] LIKE pattern [ ESCAPE escape_character ]
Work example
A report needs LIKE to define which rows satisfy a compound search condition.
Test a match, a nonmatch, and NULL. Write the expected TRUE, FALSE, or UNKNOWN result before running the filter.
Check your work LIKE. The rows kept by LIKE are exactly those whose complete condition evaluates to TRUE.
Practice SQL
Open in SQL FlowSELECT Label FROM (VALUES (N'alpha'), (N'beta')) AS Items(Label) WHERE Label LIKE N'a%';
Open Microsoft Learn for full syntax, permissions, and details for your version.