I have a list of movies that I have grouped by letter. Naturally, the movies starting with the letter "T" have about 80% of movies that begin with "The". Movies such as "The Dark Knight" should appear in the "D" list, and preferably in the "T" as well. Any way I can do that?
I use the following code in the WHERE clause to display movies that start with a certain letter, ignoring "the", but this also had a convenient side effect of having a movie such as "The Dark Knight" appear for letter "D" and "T".
WHERE movie_title REGEXP CONCAT('^(the )?', '$letter')
I would like to achieve this when I echo out all the movies that are in the database.