How to get mySQL to ignore "A, An, & The" when presenting alphabetized book titles
December 5, 2006 8:36 AM
Subscribe
mySQLfilter: How can I ignore "A, An, & The" at the beginning of book titles when sorting results alphabetically by title?
I have a database of several hundred book titles and I'd like to be able to list them alphabetically, but ignore any articles that may be at the front of title.
For example, consider the following 3 titles as they appear in the db:
"A Summer's Day"
"Beach Fun"
"Zebras Are Neat"
I'd like them to appear, in order, as:
"Beach Fun"
"A Summer's Day" (See? Ignoring the first article "A" and alphabetizing on the "S")
"Zebras Are Neat"
I'm assuming that there's some sort of conditional code I could use in mySQL to make this easier.
I also have (some) PHP skills, so writing a helper function or two isn't out of the question.
posted by Wild_Eep to computers & internet (10 comments total)
2 users marked this as a favorite
Or something equally horrible. I'd create an extra column with this stored, however.
posted by cillit bang at 9:02 AM on December 5, 2006