SQLite LIKE Clause (Operator)
The SQLite LIKE operator is used to match text values against a pattern using wildcards. In the case search expression is matched to the pattern expression, the LIKE operator will return true, which is 1.
There are two wildcards used in conjunction with the LIKE operator:
The percent sign represents zero, one, or multiple numbers or characters. The underscore represents a single number or character.
Here, XXXX could be any numeric or string value.
We have a table named 'STUDENT' having following data:
In these examples the WHERE statement having different LIKE clause with '%' and '_' operators and operation is done on 'FEES':
Example1: Select all records from STUDENT table WHERE age start with 2.
Select all records from the STUDENT table WHERE ADDRESS will have "a" (a) inside the text: