Make MySQL ignore “The” from the start of a LIKE condition?

purenature

New Member
I have a list of company names, and want to display all the names beginning with a certain character. \[code\]d\[/code\] for example.So the query is\[code\]SELECT * FROM company WHERE name LIKE 'd%'\[/code\]But I also want the companies that start with "The" so\[code\]SELECT * FROM company WHERE name LIKE 'd%' OR name LIKE 'The d%'\[/code\]But now the tricky bit when we get to 't' I want to remove all those that start with 'The'while keeping others that begin with a 't' (and also keeping anything like 'The Truffle House' where the word after 'The' begins with a 't').Any ideas? Would like to keep the logic in MySQL...
 
Top