Can we apply the
LIKE operator to values other than
Yes, you can apply the
LIKE operator to numerical values as well.
Whenever you use
LIKE however, you must always wrap the pattern within a pair of quotations, whether for matching a number or a string.
/* This will select movies where the id number starts with 2 and is followed by any two numbers. */ SELECT * FROM movies WHERE id LIKE '2__';