|
I have a table of book titles of which I only want titles that start with the letters A-K. Also, if the titles start with "A" or "An" or "The", ignore the first word and check on the 2nd word instead. My first thought was to do a WHERE Title REGEXP "(A |An |The )?[A-K]" but it doesn't seem to be greedy so "An T..." would be accepted. Is there a clean way to do this? Also, does MySQL support REGEXP groupings? I can't seem to find a way to do so. I want to do a ORDER BY (Title REGEXP blah) where the first word is dropped if it is "A", "An" or "The". Or is there a cleaner way to do all this in MySQL without touching REGEXPs?
|
# ¿ Nov 3, 2007 04:43 |
|
|
# ¿ Apr 28, 2024 18:29 |