MySQL Tips & Tricks

Friday, January 30, 2009

Search for names of a certain length

Suppose if we want to find the names that contain exactly five characters, we use a special character "_"(underscore). The following query will list all the five letter names from the table employees.


select * from employees where firstname like '_____';

Labels: