SQLite Like Operator
SQLite Like Operator
The SQLite LIKE operator matches text values against a pattern using wildcards. This operator can be used to filter the rows based on patterns.
Syntax
The general syntax of the LIKE clause is as follows:
SELECT FROM table_name
WHERE column LIKE <pattern>
The LIKE operator supports two wildcards:
SQLite Wildcard | Description |
Underscore ( _ ) | The underscore matches a single character. |
Percent sign ( % ) | The percent sign matches zero, one, or multiple characters. |
Both the wildcard symbols can be used in combination with the search pattern.
Example
The following query retrieves all the employees whose names start with the capital letter J.
sqlite> SELECT * FROM emp
…> WHERE ename LIKE ‘J%’;
—
SQLite Tutorials
SQLite tutorials on this website:
https://www.testingdocs.com/sqlite-database-tutorials/
For more information on SQLite, visit the official website: