/* Using where with the LIKE operator */ /* % matches any 0 or more characters */ /* _ matches any single character */ SELECT * FROM student WHERE lname LIKE 'M%'; /* starting with M */ SELECT * FROM student WHERE lname LIKE '%m%'; /* contains m */ SELECT * FROM student WHERE lname LIKE 'M_'; /* 2 chars, starting with M */ SELECT * FROM student WHERE lname LIKE '_M%'; /* 2nd char must be M */ SELECT * FROM student WHERE ssn LIKE '000-0_-000_'; SELECT * FROM student WHERE lname LIKE '%A^%' ESCAPE'^'; /* the second % is no longer a wildcard */