- To return records that starts with a specific letter or phrase, add the % at the end of the letter or phrase.
- Return all wikitechytable that starts with 'p':
SELECT * FROM wikitechytable WHERE name LIKE 'p%';
- To return records that ends with a specific letter or phrase, add the % at the beginning of the letter or phrase.
- Return all wikitechytable that ends with 't':
SELECT * FROM wikitechytable WHERE course LIKE '%t';
- To return records that contains a specific letter or phrase, add the % both before and after the letter or phrase.
- Return all wikitechytable that contains the phrase 'm'
SELECT * FROM wikitechytable WHERE gender LIKE '%m%';
- The _ wildcard represents a single character.
- It can be any character or number, but each _ represents one, and only one, character.
- Return all wikitechytable with a gender starting with any character, followed by "ale":
select * from wikitechytable WHERE gender LIKE '_ale';
- Return all wikitechytable with a gender starting with "fe", followed by any 2 characters, ending with "le":
select * from wikitechytable WHERE gender LIKE 'fe__le';
- The [] wildcard returns a result if any of the characters inside gets a match.
- Return all wikitechytable starting with either "k" or "i":
select * from wikitechytable WHERE name LIKE '[ki]%';
- The - wildcard allows you to specify a range of characters inside the [] wildcard.
- Return all wikitechytable starting with "k", "l", "m", "n", "o" or "p":
select * from wikitechytable where name LIKE '[k-p]%';
- Any wildcard, like % and _ , can be used in combination with other wildcards.
- Return all wikitechytable that starts with "s" and are at least 2 characters in length:
select * from wikitechytable where course LIKE 's__%';
- Return all wikitechytable that have "q" in the second position:
select * from wikitechytable where course LIKE '_q%';