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. Syntax: or or or or Here, XXXX could be any numeric or string value. Example: 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. Output: Example2: Select all records from the STUDENT table WHERE ADDRESS will have "a" (a) inside the text: Output:
Next TopicSQLite Glob Clause
|